question

TalibULAmanKundraikar-0149 avatar image
0 Votes"
TalibULAmanKundraikar-0149 asked ShaikMaheer-MSFT commented

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

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
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @TalibULAmanKundraikar-0149 ,

Welcome to Microsoft Q&A Platform. Thank you for posting query here.

Could you please point out specific property names which you would like to take out from above json? So that i will try to implement a solution and share detailed resolution. Thank you.

0 Votes 0 ·

Hi @TalibULAmanKundraikar-0149 ,

Did you get chance to share details above requested asks?

0 Votes 0 ·

Hi

so please find the json below:
{
"pipelines":[
"Sample - Long Running Job",
"pipeline4"
],
"Sample - Long Running Job":[
300
],
"pipeline4":[
60
]

I am trying to get the value of the pipeline name - "Sample - Long Running Job" & "pipeline4" ie, 300 and 60.
}

0 Votes 0 ·

1 Answer

ShaikMaheer-MSFT avatar image
1 Vote"
ShaikMaheer-MSFT answered ShaikMaheer-MSFT commented

Hi @TalibULAmanKundraikar-0149 ,

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.



lookup.gif (1.0 MiB)
setvar.gif (518.0 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ShaikMaheer-MSFT

That pipeline name should dynamic. I need to get that pipeline4 from a variable dynamically. I am trying to see if I can get something which looks like the below.

@string(activity('Lookup1').output.value[0].{VARIABLE_NAME}.value)

0 Votes 0 ·
ShaikMaheer-MSFT avatar image ShaikMaheer-MSFT TalibULAmanKundraikar-0149 ·

Hi @TalibULAmanKundraikar-0149 ,

Thank you for follow up query.

Unfortunately, making dynamic expressions as dynamic again is not possible at this moment.

I would encourage you to submit feedback item for this. Product team closely monitor all feedback items and consider them for feature releases.

Please consider Accepting Answer. Accepting answer helps community as well. Please let us know if any further queries. Thank you.

0 Votes 0 ·

Hi @TalibULAmanKundraikar-0149 ,

Following up to check is above answer helps you. Please Accept Answer. Accepting answer helps community as well. Please let us know if any further queries. Thank you.

0 Votes 0 ·

Hi @TalibULAmanKundraikar-0149 ,

Just checking is above answer helps you. Please Accept Answer. Accepting answer helps community as well. Please let us know if any further queries. Thank you.

0 Votes 0 ·