question

Jay-8106 avatar image
0 Votes"
Jay-8106 asked Jay-8106 commented

ADF Pass JSON from IF Condition to Execute Pipeline

I have a job moving xml files from an ftp to on-prem fileserve and I must check first if there are any files to collect.

To do this I'm using a If Statement and because my pipeline has a For Each I can't put this in an If so have put it into another pipeline.

103915-image.png

103877-image.png

103840-image.png

My question is I'm checking metadata twice and it works OK but is it possible to pass the JSON result from the first metdata above to the execute pipeline so I can remove the second Metadata task and then the filters work on output from First Metadata select?

azure-data-factory
image.png (18.7 KiB)
image.png (6.6 KiB)
image.png (12.4 KiB)
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

PRADEEPCHEEKATLA-MSFT avatar image
0 Votes"
PRADEEPCHEEKATLA-MSFT answered Jay-8106 commented

Hello @Jay-8106,

Thanks for the question and using MS Q&A platform.

You can pass parent pipeline using the GetMetaData output property values to Child pipeline.

To do the same you need to create a parameter in child pipeline to receive data from parent pipeline.

For example, in below example I'm passing Parent pipeline GetMetaData activity output property Exists to child pipeline

Master Pipeline:

104208-parentpipeline.gif

Child Pipeline:

104209-childpipeline.gif

Hope this helps. Do let us know if you any further queries.


Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


parentpipeline.gif (1.3 MiB)
childpipeline.gif (163.7 KiB)
· 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.

Ah thanks this looks good I'll take a look.
So from your above example do I also not need the IF condition as your using the Exists?

0 Votes 0 ·

Hello @Jay-8106,

Exists property from the GetMetaData will tell you file exists or not. You need to take that property in to If activity to evaluate true or false.

Inside If activity, if exists property value true then execute set of activities & if exists property if false execute different set of activities.

Below the example to write expression in If activity.

104570-image.png

Hope this helps. Do let us know if you any further queries.

0 Votes 0 ·
image.png (283.8 KiB)

Thanks that's perfect

0 Votes 0 ·