powerbi

update dataset parameters via API


I'm using the session ID from our work management system to authenticate connection to the system in Power BI. Because the session ID changes frequently, I set it up as a parameter in my M query.

I can update the parameter (and subsequently the dataset) by navigating to the Power BI Service settings for the published dataset and entering the new value. I'm trying to see if there's an easier way to make the update, and I came across the Power BI API call for Datasets - Update Parameters.

I've been unable to make it work from the Learn site's 'Try It' UI--I keep getting a "Dataset Parameters list is invalid in [dataset]. Reason: Empty" error.

In looking online, the most common reasons for this error seem to be that the parameter type is set to 'Any' or that 'Enable load' is not checked. However, my parameter type is 'Text' and both my query and parameter have 'Enable load' checked.

Are there any other fixes I should be trying to address this issue? Thanks in advance.


Solution

  • I added the parameter name and value to the request body in the Learn site's API module, and the call ran without an error.