Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Anonymous
Not applicable

Post API with JSON Array in Body

Hi all,
I hope you had a great Christmas!

I'm new working with APIs in BI. I have a json body that works well when there is one carrier.

= Text.ToBinary("{""object_type"": 7, ""carrier_id"": 20}")

But I need to add more than 30 carrier and it will be a pain to create a query for each carrier.

Does anyone know if it possible to add an array to the existing json body?


This is what I had in mind but it didn't work.

Text.ToBinary("
[
{""object_type"": 7, ""carrier_id"": 1},
{""object_type"": 7, ""carrier_id"": 2},
.............
{""object_type"": 7, ""carrier_id"": 30},
]
")


Any help would be appreciated. 🙂

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

Text.ToBinary can only deal with one elemental, I suggest you to try List.Transform or List.Generate which can process multiple elements one by one in a queue:
List.Transform - PowerQuery M | Microsoft Learn
List.Generate - PowerQuery M | Microsoft Learn

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.