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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
prabhat_m
Frequent Visitor

Forming API Query from a table

Hi,

 

I'm trying to generate an API query which takes multiple webids as input from table values.

 

If I directly type the query as below I get the response:

prabhat_m_0-1666388856293.png

The Query works as below, passing each webid seperately.

prabhat_m_1-1666388966929.png

 

However, If I pass the webids from a table value (Custom Invoke using Json.Document(Web.Content("https:/apiserver.com/piwebapi/streamsets/value",[Query=[webid={ Column1}]])), the URL is getting passed with only webid as whole 

 

prabhat_m_2-1666389339391.png

 

prabhat_m_3-1666389466748.png

How to make this work so that all the value from the Coloumn can be passed in the query and it considers as seperate WebIds.

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @prabhat_m ,

Please update the code as below and check if it can work or not...

Json.Document(
  Web.Content(
    "https:/apiserver.com/piwebapi/streamsets/value", 
    [Query = [webid = Text.Split([Column1], ",")]]
  )
)

Any comment or problem, please feel free to let me know.

Best Regards

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@prabhat_m , Please check if this can help you

https://blog.crossjoin.co.uk/2016/08/16/using-the-relativepath-and-query-options-with-web-contents-i...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank Amit.

I'm using the same to form tables where cow from the example is webid.

I am trying to pass multiple query parameter for ex: Query=[q="cow","goat","dog"] which workis in the API that I'm using if I harcode it. It makes propoer query as api?q=cow&q=goat&q=dog and goes through.

 

However if I pass "Cow","goat","dog" from a coloum in a table, it is not working and the query becomes api?q="cow","goat","dog" which is incorrect format

Anonymous
Not applicable

Hi @prabhat_m ,

Please update the code as below and check if it can work or not...

Json.Document(
  Web.Content(
    "https:/apiserver.com/piwebapi/streamsets/value", 
    [Query = [webid = Text.Split([Column1], ",")]]
  )
)

Any comment or problem, please feel free to let me know.

Best Regards

Worked like a charm!! 
Thank you!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.