question

BalwinderKaur-5937 avatar image
0 Votes"
BalwinderKaur-5937 asked NandanHegde-7720 commented

Is it possible to read/get parameter value from a source file

I am new to ADF, have a question
I have an excel file with some values that I want to use as parameters in the pipeline. For example instead of passing the parameters value in the pipeline , can we get the value from that source file which is uploaded in azure storage account.
And if we make any change in the value in the source file or drop a new file with different values it updates the corresponding parameter value in pipeline.
The pipeline will have a storage trigger so , when that file is dropped in the blob storage it will trigger the pipeline.
Thank you

azure-data-factoryazure-synapse-analytics
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.

1 Answer

NandanHegde-7720 avatar image
0 Votes"
NandanHegde-7720 answered NandanHegde-7720 commented

Hey,
It is possible to read your config data in file via lookup activity :
https://docs.microsoft.com/en-us/azure/data-factory/control-flow-lookup-activity

Rather than parameter, you would need to create variables in ADF or leverage the output values of the lookup activity in your other activities .
The below example shows how to read a JSON file :
https://docs.microsoft.com/en-us/answers/questions/502952/how-to-read-specific-column-value-through-lookup-a.html

· 5
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.

Thank you Nandan, The file that will trigger the pipeline has four columns with different values and those values will be used in the web activity(Rest API Call) in the pipeline. I can read the values with the look up activity but how do I pass those values to the variables so that I can have first value as variable 1, second as variable 2 and so on. Here is a how the output of the look up activity looks like:
Output
{
"count": 1,
"value": [
{
"InstanceCode": "ABC",
"VersionName": "XYZ2020/2021",
"TimeSpanStart": "08/2020",
"TimeSpanEnd": "06/2021"
}
],
I have defined four variables to pass these values individually at the pipeline level and in the set variable activity I provided this value @string(activity('Lookup1').output.value) , its returning all the values. I also tried entering name of the specific column like InstanceCode but nothing worked, it says property doesn't exist.
so my question is , what output property can I use so that I can use first value as var 1 and second as var2 and so on.

Thank you ,appreciate your help.

0 Votes 0 ·

Hey,
Can you try the below:
@activity('actname').output.value[0].instancecode

And also can you upload the text version of file for us to look into if the above doesn't help

0 Votes 0 ·

it worked , thank you Nandan

0 Votes 0 ·
Show more comments