Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi!
For a dashboard im building I need to retrieve data using an API. However, within the URL of the API I need to specify an ID-like number to retrieve descriptive values. An example:
HTTPS://WWW.API_LINK.COM/category_line/(ID)/line
I have a table filled with Category_ID which I need to retrieve the data using the API above. So what i'm trying to do is:
HTTPS://WWW.API_LINK.COM/category_line/ LOOP(Category[ID]) /line.
However, the Powery Query Editor keeps telling me that I cannot combine functions like this together. Thus, I was wondering if there is any other (perhaps better) way of doing this WITHOUT changing the nature of the API.
Thanks so much in advance!
If your id is in a column called ID, you should be able to add a custom column with an expression like this.
= Web.Contents("HTTPS://WWW.API_LINK.COM/category_line/" & [ID] & "/line"
You many need to convert that column to text before this step, or use & Number.ToText([ID]) &
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi Pat!
First of all, thank you for taking the time to reply!
I used your solution, however, it gives me the following error:
Expression.Error: We cannot apply operator & to types Text and List.
Details:
Operator=&
Left=https://www.api-link.com/api/category/
Right=[List]
this is the line I have in set:
Json.Document(Web.Contents(#"API URL"&"/api/Category_line/"&Number.ToText(category[id])
Thank you in advance for replying!
Kind regards,
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |