The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
We're using the REST API to give our users access to their reports through another web page. More and more users are requesting more fine grained control through bookmarks and filters. The last post I could find about this, confirming that there is no way to do this via the REST API dates from 2021. It's 3 years later now; is there still no way to do this or am I overlooking something?
If this is indeed still unavailable, where do I go to request this feature (I'm new to this community).
Thanks, Pascal
Actually, I found that with the PowerBI Javascript library I was able to get and apply bookmarks, as well as apply filters. I use the powerbi.embed function to embed a report into my web page.
Filters can be applied by adding them to the embed configuration, which is passed as a second parameter to this function, like so:
const filters = [
{
$schema: "http://powerbi.com/product/schema#advanced",
target: {
table: "powers",
column: "thirdPower"
},
conditions: [
{
operator: "LessThan",
value: 700000
}
],
filterType: 0
}
];
powerbi.embed(domNode, { pageView: "fitToWidth", filters: filters });
Bookmarks can be retrieved from a report once it's embedded. You get the report object through powerbi.embeds[0], with which you can do the following:
powerbi.embeds[0].bookmarksManager.getBookmarks().then(
function (bookmarks) { <PROCESS BOOKMARKS> },
function () { <PROCESS ERROR> },
)
A bookmark contains a name and a displayName attribute. Using the name attribute, you can apply the bookmark when embedding the report again, like so:
powerbi.embed(domNode, {
pageView: "fitToWidth",
bookmark: {
name: <SELECTED BOOKMARK NAME>
}
})
Consider using PDLs instead (ideally externally managed for user on-boarding and off-boarding)
Anyway,
If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com/?forum=2d80fd4a-16cb-4189-896b-e0dac5e08b41