How to concatenate 1 variable name with 1 variable value in Azure Datafactory

Talib UL Aman Kundraikar 1 Reputation point
2021-08-06T16:00:00.38+00:00

Hi
I have a situation:

I have a Universal Json file which has a value for each jobs. So I need to grab that specific pipeline name from the json file.

Example:
{
"pipelines":[
"Sample - Long Running Job",
"pipeline4"
],
"Sample - Long Running Job":[
300
],
"pipeline4":[
60
]
}
how do i get the value of pipeline4 dynamically.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,196 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,401 Reputation points Microsoft Employee
    2021-08-11T06:52:23.783+00:00

    Hi @Talib UL Aman Kundraikar ,

    Thank you for posting query in Microsoft Q&A Platform and sharing details on requested asks.

    In below example, I saved your json as file and using lookup activity getting that file content. And then, I am trying to save pipeline4 value in some variable. Kindly check below and follow same. Thank you.

    Step 1: Look up activity
    122263-lookup.gif

    Step 2: Set Variable
    expression used: @string(activity('Lookup1').output.value[0].pipeline4[0])
    122234-setvar.gif

    Please Note, Try to avoid spaces in Json Key values. Because if keys as spaces then ADF expressions language cannot interpret them.

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

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

    • Please accept an answer if correct. 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.
    1 person found this answer helpful.