![how to update dataset in rdlc parameters how to update dataset in rdlc parameters](https://oakdome.com/programming/images/ssrs_dyndataset8.png)
Want to download the PowerShell scripts to perform these actions? Get it from my GitHub repo.When you design RDL(C) Layouts, you usually work with datasets. Invoke-PowerBIRestMethod -Url $ApiUrl -Method Post -Body ("$ApiRequestBody") The rest if pretty straight-forward, and we invoke the API call with the following cmdlet: #Update parameters I’ve had a few instances where some special characters (hidden to the naked eye) caused havoc and took forever to identify as the root cause for the failures.
HOW TO UPDATE DATASET IN RDLC PARAMETERS CODE
Be careful when copying and pasting the code from Microsoft’s official API documentation.Error messages returned by the API aren’t very descriptive and troubleshooting will be painful if you don’t get the request body one hundred percent correct.The API is very touchy-feely about syntax, so pay attention to capitalization, spacing etc.This will look a little odd if you’ve used indentation to make your code more readable, but required to make it work. The catch here is that the closing has to be the first characters on the line without any preceding characters (including spaces). We’re making use of a multi-line string to build the body of the API request, denoted by at the start and at the end.
![how to update dataset in rdlc parameters how to update dataset in rdlc parameters](http://4.bp.blogspot.com/-QYvThwOfXcs/VH576SybUgI/AAAAAAAAGFQ/-Rc5Htsl1rI/s1600/Add%2BDataset.png)
Before we wrap this up with the actual API call, there’s a few things I need to point out: "name": "Customer Name", "newValue": makes it easy to interject our parameter $CustomerName into the text of the body as you can see from the snippet above. The request body contains all of the required info to update the parameter(s), and the syntax looks like this: #Build the request body To update parameters, we’re going to use the UpdateParameters operation which takes the following form: /Default.UpdateParameters The request body
![how to update dataset in rdlc parameters how to update dataset in rdlc parameters](https://i.ytimg.com/vi/hkDIDTNbA6M/maxresdefault.jpg)
Setting the sceneįor the purposes of this blog post, let’s assume you have a report that you’d like to customize for different customers and deploy to their workspaces. Fortunately there is an Invoke-PowerBIRestMethod cmdlet that makes it possible to use the API in PowerShell without the need to deal with some of the underlying complexities. REST APIs are usually a little tricky to deal with, especially the process of authentication. One such thing is updating parameters, and we’re going to use the Power BI REST API (which the cmdlets use underneath the covers anyways) to achieve that. We’ve only used the PowerShell cmdlets for Power BI so far in this series, but things are about to get interesting because there aren’t cmdlets available for everything you might want to do. This blog post is part of my “Automating Power BI deployments” series, and you can find a list of the other posts here.