{"id":10385,"date":"2018-09-21T00:00:00","date_gmt":"2018-09-21T05:00:00","guid":{"rendered":"https:\/\/threecloud.wpengine.com\/post\/nesting-foreach-loops-in-data-factory\/"},"modified":"2022-11-30T09:12:04","modified_gmt":"2022-11-30T15:12:04","slug":"nesting-foreach-loops-in-data-factory","status":"publish","type":"post","link":"https:\/\/3cloudsolutions.com\/resources\/nesting-foreach-loops-in-data-factory\/","title":{"rendered":"Nesting ForEach Loops in Data Factory"},"content":{"rendered":"<p>If you\u2019re working in Azure Data Factory or are just starting out with it, today I\u2019m here with a quick design tip when it comes to Azure Data Factory pipelines.<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/V4SQfhea4lA\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<p>In a scenario where you\u2019re using a ForEach activity within your pipeline and you wanted to use another loop inside your first loop, that option is not available in Azure Data Factory. If you look at the screenshot below, you can see that the option to add an additional ForEach loop is not available.<\/p>\n<p><img decoding=\"async\" style=\"width: 675px; display: block; margin-left: auto; margin-right: auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2021\/09\/NestingForEachLoopsDataFactory.jpg\" alt=\"NestingForEachLoopsDataFactory\" width=\"675\" \/><\/p>\n<p>So, here\u2019s my design tip \u2013 if you have a scenario where you want to do a loop inside a loop, you would need to create an additional pipeline as a separate object. And in that second pipeline is where you would put your second loop.<\/p>\n<p>Again, looking at my screenshot, I\u2019m working in the context of one ForEach loop and so this pipeline will be executed one time for each item in my list but that pipeline, in turn, is where I have an additional ForEach loop.<\/p>\n<p>Hope you find this quick design tip helpful if you run into this scenario.<\/p>\n<p>Need further help? Our expert team and solution offerings can help your business with any Azure product or service, including Managed Services offerings. Contact us at 888-8AZURE or\u00a0 <a href=\"mailto:sales@3cloudsolutions.com\">sales@3cloudsolutions.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019re working in Azure Data Factory or are just starting out with it, today&mldr;<\/p>\n","protected":false},"author":32,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[260],"tags":[],"class_list":["post-10385","post","type-post","status-publish","format-standard","hentry","category-data-ai","topics-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/10385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/comments?post=10385"}],"version-history":[{"count":0,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/10385\/revisions"}],"wp:attachment":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media?parent=10385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/categories?post=10385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/tags?post=10385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}