An API makes available a list of products but product details are only available by product ID. So, in order to retrieve a products’ shelf-life, a product ID is required. This means that the API has to be called for each product in the list in order to retrieve the shelf-life of all products.
How do I retrieve each products’ shelf-life via the API in the Query Editor?
This looks like it requires some kind of M-code loop, perhaps??
I have limited experience with APIs in Power Query Editor, but is it possible to pull the list of products as an independent query/table, then the product details as an independent query/table, then use query dependencies to create a relationship between the two?
Zherkezhi,
The question is more about how to retrieve product details from a data source (API) while looping through each product ID from a table/list in Power BI. API knowledge is not really necessary. How to retrieve the product details while looping for each product ID is the question.
Gotcha, I can’t help with M code looping, other than sharing this reference: https://potyarkin.ml/posts/2017/loops-in-power-query-m-language/
I would try to pull each table independently and then do a left join merge on both of those tables if that is a possibility. I hope this helped at least a little bit.
Hi @powerbideveloper, did the response provided by @Zherkezhi help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query. Thanks!
I am still working through it and struggling to get a solution at this point. Additional comments/suggestions by others might be helpful.
2 Likes
Hi @powerbideveloper! Looks like your inquiry was out of the experts and users’ bounds. Due to inactivity from our users, we’ll be marking this thread as “SOLVED”.
While our users and experts do as much as reasonable to help you with your inquiries, not all concerns can be attended to. Hope you understand.