cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PhillipRothwell
Regular Visitor

Use CSV column as custom parameter

Hi I'm exploring the use of API to extract data for use in Power BI. Take the following as a particular call

 

https://mrurl.com/api/coursecode/33795/analytics/activity

s

I have a CSV containing a list of course codes similar to the one below

 

course_code

64726

43447

63794

29471

63803

 

What I'm aiming to do is loop through all values in that csv and inject these as a custom parameter into the above api request using  M in the custom query view. The resulting request would look like something below

 

https://mrurl.com/api/coursecode/{course_coderow1}/analytics/activity

https://mrurl.com/api/coursecode/{course_coderow2}/analytics/activity

https://mrurl.com/api/coursecode/{course_coderow3}/analytics/activity...... etc etc

 

Does anyone know the best way to approach this?

 

Thanks in advance 🙂

 

Phil

1 REPLY 1
Microsoft v-yulgu-msft
Microsoft

Re: Use CSV column as custom parameter

Hi @PhillipRothwell ,

 

As Imkef suggested here, you should firstly load the CSV file into desktop as a query, that holds all the variables/parameter and add a custom column to it where you make your API call, thereby referencing the column(s) with your variables where needed. That will return a colum with all the values from the different rows of your table that you can simply expand. 

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors