Forum Discussion
Looping through Parameters for API calling
- 7 years ago
Hi Anonymous,
That's because the return type of Web and Json are different. You can't replace the function directly. I would suggest you create a single query and copy the code to the function [url]. Please refer to the snapshot below.
Best Regards,
Dale - Anonymous7 years ago
Literally overcomplicated it, this function once invoked will return a record of data for every URL in the Loop, storing them in the custom column. Posting for future solutions. v-jiascu-msft thank you again Sir for your time and help!
Hi Anonymous,
Please download the demo from the attachment. I would suggest you create a function to call the APIs then combine the results together.
(url as text) =>
let
Source = Web.Page(Web.Contents(url)),
Data0 = Source{0}[Data]
in
Data0
Best Regards,
Dale
- Anonymous7 years agoNot applicable
hello v-jiascu-msft
I think that is the right track for sure, I am pulling a JSON object so the code reflects the following
I then create a custom column by invoking the above function.
However, once I try to call the data from the API i'm given a column of errors with the following:
Is there a way to trouble-shoot around this, it is defiently reaching and calling from the API. I'm worried that BI cannot interpret the data. Thank you again for your help.
- v-jiascu-msft7 years ago
Microsoft Employee
Hi Anonymous,
That's because the return type of Web and Json are different. You can't replace the function directly. I would suggest you create a single query and copy the code to the function [url]. Please refer to the snapshot below.
Best Regards,
Dale- Anonymous7 years agoNot applicable
v-jiascu-msft/Dale,
I just want to say thank you in advance for your patience, this is my very first BI project.
1. I have updated my function to reflect the correct data types, and reference them in a variable {Docs}.
2. I then invoke the custom function to call a list for each row of all 46 data types deminshioned, and get the option to drill down into that list:
3. However, even though the values are in the cells, BI will send me the following expression error (regardless of data type (number, text, date, etc.):
Expression.Error: We cannot apply field access to the type Number*.
Details:
Value=1900*
Key=Docs* = values and data types change depending on called info.
I'm assuming the crux of the issue is the Field Access given by BI. how do I work around this? Thank you again Dale.