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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jecrygier
Regular Visitor

PBIRS REST API - Get Parameters With Value

Hello -

 

I'm currently doing a PoC with PBIRS, where I need to pre-select Report Parameters.  I've found the REST API /Reports({Id})/ParameterDefinitions, and this gets me a given Report's Parameters.  However, I cannot find a way to make this call while posting the current set of parameter values.

 

For example, I have a report that takes in a Year and Month.  The month is a relative number to today.  So, if I'm rendering the report for March-2021, it will be Year=2021, Month=0.  If I switch the year to 2022, I need to re-fetch the parameters, as March-2022 would be Year=2022, Month=12, which don't come back in the first call to ParameterDefinitions.

 

This was possible with the SOAP API for SSRS, via GetItemParameters, and including something like:

<Values>
  <ParameterValue>
    <Name>Year</Name>
    <Value>2022</Value>
  </ParameterValue>
</Values>

In the request.  However, I'm having troubles finding an equivilent in the REST API.

 

Thanks in advance!

5 REPLIES 5
v-janeyg-msft
Community Support
Community Support

Hi,  @jecrygier 

 

What do you want in PBI report server? If you want to filter data, you can also use parameter url.

Parameter url:Filter a report using query string parameters in the URL - Power BI | Microsoft Docs

Reports({Id})/ParameterDefinitions: PBIRS | 2.0 | microsoft-rs | SwaggerHub

 

Best Regards

Janey Guo

 

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

Hi @v-janeyg-msft -

 

Thanks for the reply.  We have a requirement where we need to be able to create "Saved Filters", which will be a screen before we render the actual report.  Due to this, when I did a PoC in SSRS, I was using the GetItemParameters via SOAP to get the Parameters for a report.  I have found the ParameterDefinitions REST API that is nearly equivalent...but doesn't seem to let me handle situations like cascading dropdowns.

 

So, our plan is to somehow get the parameters for the reports, while allowing for things like cascading dropdowns interactively, before rendering the report.  Then, forward to the report server while passing in the selected filters as you describe above.

 

I just can't seem to figure out how to do the cascading dropdown part in REST (as we prefer it over SOAP).

 

Thanks again!

Hi, @jecrygier 

 

'So, our plan is to somehow get the parameters for the reports, while allowing for things like cascading dropdowns interactively, before rendering the report.  Then, forward to the report server while passing in the selected filters as you describe above.'

 

I tried to understand you, but failed. It's hard for me to find information related to what you are talking about in powerbi. Do you want to open the report on PBI report server? When the report is made, you can control how it displays when it is opened. Why make simple things complicated?

Calling SOAP API in Power BI (Read XML Web Service data) | ZappySys Blog

 

Best Regards

Janey Guo

Hi @v-janeyg-msft -

 

Unfortunately, our business requirements are forcing us to be a bit more complicated than we want.  We have a requirement to save a set of filters that an individual user will commonly use.  For example, if we have a report that has Country as a parameter, and Region as a parameter, one individual will commonly view the report for "USA" / "Midwest" and another might commonly view the report for "USA" / "South".  They don't want to have to pick these filters from a dropdown every time the go into the system.

 

These parameter selections also happen to be configured in the RDL, and in the example above, "Region" would be dependent on "Country".  So, when I pick "USA", the Region dropdown only shows USA regions, and not Australia regions.  This functionality is built into PBIRS when I render a report.  I just need it outside of rendering, so I can handle the 'saving' part.

 

Again, I have found this to be possible over SOAP (ReportingService2010.GetItemParameters(String, String, Boolean, ParameterValue[], DataSourceCredenti...)...but greatly prefer to do it via the REST interface, as it seems more flexible, and has more information.

 

Thanks again

--John

Hi, @jecrygier 

 

Do you have tried '/PowerBIReports({Id})/Properties'? It is similar to the SOAP API you mentioned.

According to your description, I think the best way is to use RLS for users.

PBIRS | 2.0 | microsoft-rs | SwaggerHub

Row-level security (RLS) in Power BI Report Server - Power BI | Microsoft Docs

 

Best Regards

Janey Guo

 

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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