pass variables inside foreach loop in parent pipeline to execute child pipeline in adf

Sukanya Cu 21 Reputation points

A parent pipeline has foreach loop having activities to capture variables and execute pipeline(calls databricks notebook). How can I get the variable values passed to a excute pipeline.

Activities inside foreach loop is in below picture

Child pipeline in execute pipeline1 is given below and I have added a parametrs in child pipeline which has the same name as variable name passing from foreach loop. But its unable to gte the variable value passed. I also tried (@variables('start_date), but not working. Please help and let me know what is missing here.

I have refered the methods mentioned in link :
@HimanshuSinha-msft I have followed your steps, but could you pls help where is it missing

Thanks in advance

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
1,385 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
7,138 questions
0 comments No comments
{count} votes

Accepted answer
  1. MartinJaffer-MSFT 25,711 Reputation points

    Hello @Sukanya Cu ,
    Thanks for the question and using MS Q&A platform.

    As we understand the ask here is how to pass variables from a parent pipeline to a child pipeline via the Execute Pipeline activity .

    You are halfway there! Variables and parameters are not passed automatically from parent to child pipelines, you need to specify them in the execute pipeline activity like shown below. Connecting the Set Variable to Execute pipeline is not mandatory, but helps ensure the variable is set appropriately before trying to pass it (otherwise might not be right value!)


    There is one more thing you should be aware of, since you are using Set Variable in a ForEach loop. Activities in one loop can overwrite the values set to variable in another loop. Therefore it would be safer to move the logic from the Set Variable activity to directly inside the Execute pipeline activity.


    Please do let me if you have any 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
    0 comments No comments

0 additional answers

Sort by: Most helpful