none
Dynamic variable in azure data factory pipeline

    Question

  • Hello Team,

    I want to create dynamic parameter in pipeline below is my requirement :-

    i have source file at ADLS and file name is abc_20181223232345.txt

    and i have create pipeline and have three component 

    lookup foreach and copy acitivity.

    and i am getting date from lookup activity (run time i am getting date 20181223).because i need to pick same date from ADLS.

    now for each loop its look from my source file so far i have created one parameter name GetFilename =@{item().AMPSDates}

    AMPSDates(20181223) is a column name for lookup activity.

    now i am creating the source and given the folderpath and file name (@concat('abc',@{dataset().GetFilename},'*.txt'))

    now i want to create dynamic variable so i can call my source file dynamically .please help me out for filename ..

    what i can give at filename portion code then i can call my source file abc_20181223232345.txt.

    majer goal is to call the filename runtime using lookup values .

    Regard's

    Ravi

    Friday, June 22, 2018 12:02 PM

All replies

  • 1. To pass your lookup result to foreach items

     "items": {
                            "value": "@activity('Lookup1').output.value",
                            "type": "Expression"
                        },

    2. To pass each date to your dataset parameters

     "parameters": {
                                            "GetFileName": {
                                                "value": "abc_@{item().AMPSDates}232345.txt",
                                                "type": "Expression"
                                            }
                                        }

    3. Then in you dataset, just reference the dataset parameter

      "fileName": {
                    "value": "@dataset().GetFileName",
                    "type": "Expression"
                }

    Friday, June 22, 2018 12:40 PM