Forum Discussion
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
- v-janeyg-msftCommunity 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.
- jecrygierRegular Visitor
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!
- v-janeyg-msftCommunity Support
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