Skip to content

Get correlation ID

liavZayde edited this page May 20, 2020 · 3 revisions

Overview

The getCorrelationId API lets you get the current Power BI embed correlation ID.

The Power BI embed correlation ID can be used to correlate your application session ID with the Power BI embed session ID. Supplying it to Power BI support will allow us to have additional debugging information.

The getCorrelationId function can be called from any type of embed artifacts (report, dashboard, dashboard tile, etc.).

Definition

/**
* @returns {Promise<string>}
*/
getCorrelationId(): Promise<string>;

The function returns the embed correlation ID.

Code samples

report.getCorrelationId().then((correlationId) => {
    ...
});

Example of how to get the correlation ID when an error occurs.

dashboard.on("error", function (error) {
    dashboard.getCorrelationId().then((correlationId) => {
        console.log("Error occurred in embed session: " + correlationId + " Error: " + error.detail.message);
    });
});

Limitations

The getCorrelationId will work only after the report is loaded.

Clone this wiki locally