Skip to content

Get correlation ID

Amit Shuster edited this page Jan 24, 2021 · 3 revisions
ℹ️ This wiki has been deprecated
All our Client APIs documentation and references can be found in the new Power BI embedded analytics Client APIs documentation set.
For the content of this article see Use the Power BI correlation ID.

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.