Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I'm having problems loading values into JSON array for HTTP POST call over PQ. Raw JSON body is quite simple:
By hardcoding this in M, POST-call works fine:
let
Source = Json.Document(Web.Contents("https://api.mytest.com/case/666d8380-7a76-410c-8eeb-b94d7248fb96/revoke-me",
[Headers=[#"Content-Type"="application/json", #"x-token"= myKey], Content= Json.FromValue([
template = "string",
case_ids = {"5e76fcaf-2e27-4c0a-a14b-6ce05b9e79f3", "8b801bdb-1f46-4548-80e0-7a4e0b6978a2"}
//case_ids = {myInput}
])]))
in
Source
But here is the problem. While hardcoding the array works fine, I need to keep it dynamic and load values through parameter in a dynamic way, like the commented-out case_ids = {myInput}
Drilled down data would be coming from Excel named range or table. My go-to option has been to drill down the value as additional data connection (myInput) and then use as input parameter. Parameter drill down output looks like this to mimic how JSON array looks like:
Using this as input will NOT work and API doesn't recognize it being a collection of two separate values which it should process one-by-one. With that being said, when I'm only passing a single value - not multiple concatenated values through myInput parameter, it does work fine:
This will indeed keep the query parameter dynamic, however given there can be several values that need to be processed, I'd need to run the query several times. But there's surely a better way?
What am I doing wrong in passing those multiple values to JSON array?
Hi @crossover ,
Please refer to the following blog:
It introduces how to andl multiple URL query parameters with the same name using Web.Contents.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I tried adding several separate parameters to send a single value through each - this works again, which at least decreases the amount of queries needed, though still not that flexible. And further suggests it's likely a data concatenation issue.
case_ids = {input1, input2, input3}
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!