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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

M Language - Need to query an API with a List of values as parameter

Hello guys,

I hope you're doing well.

I'm struggling about a code in Power Query.

Basically, what I want is to query an API with a list (named list_id) as a parameter.

 

Let's consider the following code :

Mohamed_59_5-1697199880261.png

 

It works pretty good if I put myself an ID or a list of IDs as Parameter :

Mohamed_59_2-1697199319680.png

Mohamed_59_3-1697199345126.png

But if I put directly my list of values (List_ID) as a paramater, it didn't work :

Mohamed_59_4-1697199497795.png

I tried several things but without any success 😕

 

Can you guys give me some help please ?

 

Thank you.

 

 

 

 

 

 

1 ACCEPTED SOLUTION
ImkeF
Community Champion
Community Champion

Hi @Anonymous ,
yes, that't to be expected.
The function is defined to be only working with text values as input.
What you have to do if you want to run this function on multiple values that currently sit in a list, do the following:
1) Transform the list into a table

2) add a custom column to that table where you call the function and reference the first column of the table as input for the function.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

2 REPLIES 2
ImkeF
Community Champion
Community Champion

Hi @Anonymous ,
yes, that't to be expected.
The function is defined to be only working with text values as input.
What you have to do if you want to run this function on multiple values that currently sit in a list, do the following:
1) Transform the list into a table

2) add a custom column to that table where you call the function and reference the first column of the table as input for the function.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Anonymous
Not applicable

Thanks for the response ImkeF !

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.