Share via

loop in ADF

arkiboys 9,711 Reputation points
2022-04-14T12:08:44.417+00:00

Hello,
in my ADF, There is a lookup activity which reads a column from a csv file.
After the lookup, there is a loop activity which loops through each of the records in the csv.
Inside the loop activity there is a copy activity which calls an api by building a url string as follows:
https://site/valuefromLoop...ID eq (''', dataset().ID, ''')')

Question:
As you see above, the url is being built one ID at a time...
How is it possible so that I use several, say 10 IDs at a time, i.e. something like:
https://site/valuefromLoop...ID IN ('ID1', 'ID2', 'ID3', 'ID4', etc.)')

Thank you

Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.

0 comments No comments

Answer accepted by question author

AnnuKumari-MSFT 34,571 Reputation points Microsoft Employee Moderator
2022-04-18T10:12:56.607+00:00

Hi @arkiboys ,

Thankyou for using Microsoft Q&A platform and posting your query .

As per my understanding about your question, it looks like you want to know if there is any possibility to hit multiple REST API URLs at once using IN clause. Please let me know if my understanding about your query is not correct.

There are possibilities of using optional parameters in the URL provided the source URL supports the same. This filter is applied on top of the result set we get out of the API URL.

As in your case ,You want the web activity to be parallelly triggered specifying the list of IDs in the URL itself . It doesn't seem to be possible. Best possible solution would be to use ForEach block without checking Sequential option so that it would parallelly execute web activities for all the IDs coming as the lookUp output.

Below is a simple use case where this functionality of using optional parameter would work for getting the list of resource name with a particular tagName or list of resources within specified Resource group lists etc.

Resources - List - This is the article which talks about using optional URI parameters such as $expand , $filter, $top etc.

$filter=startswith(tagName, 'depart') : This query will return all resources with a tag name prefixed by the phrase depart (i.e.department, departureDate, departureTime, etc.)
$filter=resourceGroup eq 'annu-rg' or resourceGroup eq 'adf-rg' : This will return all the resources present in any one of the provided resource group name.

Hope this will help. Please let us know if any further queries.

------------------------------

  • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
    Original posters help the community find answers faster by identifying the correct answer. Here is how
  • Want a reminder to come back and check responses? Here is how to subscribe to a notification
  • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.