Forum Discussion
Iterate Through API Calls with Content
- 3 years ago
Hi Anonymous ,
Table.AddColumns should work. Very strange that your first attempt returned that error-message (if the column "payload") really has binary content in it.
However, there is a syntax-error in your second attempt, maybe fixing that will make it work:
= Table.AddColumn(payload, "Results", each Json.Document(Web.Contents(apiUrl, [Headers=headers,Content=Text.ToBinary([payload])])))
Hi Anonymous ,
Table.AddColumns should work. Very strange that your first attempt returned that error-message (if the column "payload") really has binary content in it.
However, there is a syntax-error in your second attempt, maybe fixing that will make it work:
= Table.AddColumn(payload, "Results", each Json.Document(Web.Contents(apiUrl, [Headers=headers,Content=Text.ToBinary([payload])])))
Thank you so much that worked! As a followup - when the data is retrieved it gets back different columns each time (depending on the identifiers sent in) and then to be able to visualize it I have to use the "Detect data Type" button as the final step. The problem I am seeing with this though is that since the "Detect Data Type" button actually pulls in the columns names when I set it up, if I send in different identifiers it results in an error. And I do have my Options / Settings set to "Always detect column types and headers for unstructured sources" (although it doesnt seem to be doing anything). Is there a custom function or way to call that button dynamically, as having to delete that final step and hitting "Detect Data Type" again each time isn't ideal. (I can also submit this as a separate question)