Forum Discussion
Convert a list to array and Pass to JSON body
Hi,
I'm new to Power BI.
I would like to pass existing list of values as array to the JSON body.
List
27767321
27739924
27739926
body = "{""taskId"":[27767321,27739924,27739926]}", <-- THIS WORKS
However, I want to make it dynamic and pass an array. with opening and closing square brackets in the JSON body "[" "]"
Please help me:
1. Convert a list to an array
body = "{""taskId"":" & [listname] & "}",
2. Have JSON body with Square brackets to specify array of list
Anonymous try following,
on your list , click advanced editor and add following step
MyList = Text.Combine( LastStepofList, ",") In MyList
Basically it will combine your list into text, comma seperated and in your json query, in advanced editor do following:
body = "{""taskId"":[" & MyListQuery & "]}",
1 Reply
- parry2kSuper User
Anonymous try following,
on your list , click advanced editor and add following step
MyList = Text.Combine( LastStepofList, ",") In MyList
Basically it will combine your list into text, comma seperated and in your json query, in advanced editor do following:
body = "{""taskId"":[" & MyListQuery & "]}",