azureswitch-statementazure-data-factory

Azure Data Factory: Accessing a variable value set inside a Switch activity outside of the Switch in the same pipeline


There is already an answer to possibly the same thing here: Get Output of Copy Activity present Inside the Switch in Azure Data Factory

But how exactly does this work: "Using a Pipeline variable and set variable activities inside every case and storing the activity output(rowsWritten) and using that variable outside Switch activity"?

I have tried to do this so that the Switch activity and the Set variable activity trying to use the activity output from the Switch are in the same pipeline. Can this even work?

This should give an idea on what I'm trying to do: enter image description here enter image description here This is how I'm setting the Pipeline return value inside one case of the Switch: enter image description here This is how I'm trying to use a value retrieved from the Switch in a Set variable activity in the same pipeline: enter image description here


Solution

  • One solution is not to use the switch and keep the lookup to perform the select with a case (if possible) or use a stored procedure if the switch and lookup are on teh database it is possible