Reputation: 23
I've only started playing with Azure Logic Apps and already bumped into some problem.
The app that I'm trying to develop has a fairly simple logic: call the API, get the data and then save it to the Blob storage.
It works perfectly fine for a single request (https://example.com/rest/businessObject/objectName/details?fields=abc,dde
). However, I would like to make multiple get requests to various objects getting different fields, i.e. change the objectName in the URI and fields values in the get request. Is it possible to parametrize the call using something like JSON object, iterate over it and make different requests in a single app instead of creating multiple apps for each request? And if it's possible then how?
Update
I've used JSON parsing (big thanks to the author of response in this thread). Now my app looks like this:
Seems to work fine:
The problem that I have now however is different - I can't save the body of the response as blob as I can't access it in the create blob. The only variable available for Blob content is 'Current item' which, of course, is a chunk of JSON used in the for loop. Any ideas if it's possible to save it to the storage and how to get it done?
Upvotes: 1
Views: 749
Reputation: 442
You can do JSON parsing itself, use this example.
You can also do nesting, and also use variables and call different Logic App from another and that can be nested or loops or if-else.
If you have a fixed number of requests and not infinite then make those Logic apps, and using variables make use of Nested Logic App calls. If you have an in-definite (un-fixed) amount of API calls then a better idea would be to use Azure Durable Functions or even may be Azure Logic App as an orchestrator which then uses Azure Functions in nested calls.
Upvotes: 0