Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Applying nested bookmark in the config of the embedded report

I am trying to apply a nested (within a group) bookmark (https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-bookmarks#bookmark-groups) in the config of the embedded report as in the code below

 

 

  let config = {
        type: 'report',
        tokenType: tokenType == '0' ? models.TokenType.Aad : models.TokenType.Embed,
        accessToken: accessToken,
        embedUrl: embedUrl,
        id: embedReportId,
        bookmark: { name: "Bookmark531b9be925387024e0a0" }
    };
    let embedContainer = $('#embedContainer')[0];
    report = powerbi.embed(embedContainer, config);

 

 However I get a following error

dmitritsoy_0-1622806149300.png

 

However when I apply the same bookmark after the page is loaded 

 

    await report.bookmarksManager.apply("Bookmark531b9be925387024e0a0");

 

it works perfectly fine.

 

There is no issue when I use non-grouped bookmark and I can use it in the config directly so I have a feeling that it is a bug in api. 

 

I would appreciate any hints on how to fix it.

 

2 REPLIES 2
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous 

What kind of embed are you using, app owns data or user owns data?

If you use user owns data, you may refer to this blog: Personal bookmarks

Could this API work to apply the bookmark in Groups?

    await report.bookmarksManager.apply("Name");

This code shows how to specify a bookmark by name:

let embedConfig = {
    ...
    bookmark: {
        name: "Bookmark4f76333c3ea205286501"
    }
};

For reference: On load bookmark

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Anonymous
Not applicable

Hi Rico,

 

thank you for your message.

 

I use app owns data scenario, so I use report wide bookmarks.

As I mentioned in my original post, when the bookmark is within a group, I can't set it onload. However I can set it using  await report.bookmarksManager.apply("Name"); after the report is loaded.

 

It is not the case for non-grouped bookmark, where both approaches work.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.