question

SachinGupta-8175 avatar image
0 Votes"
SachinGupta-8175 asked KranthiPakala-MSFT edited

Data from multiple sources and deciding destination based on the Lookup SQL data

Hello,

I am trying to solve a problem where i am getting data from different sources and trying to copy that data at single destination based on the metadata stored in SQL table. Below are the steps I did.

1) I have 3 rest call and the output of those calls going as input to lookup activity.
2) The lookup activity is queried on SQL DB which has 3 records and pulling 2 columns only, file_name and table_name
3) The for each activity is iterating on the lookup array output and from each item i am getting the item().file_name.
4) now for each item I am trying to use Switch case to decide based on the file name what should be destination of the data.
5) I am not sure how I can use the file_name coming in step 3 to use as a case in switch activity. Can any one please guide me on that.

azure-data-factory
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

KranthiPakala-MSFT avatar image
1 Vote"
KranthiPakala-MSFT answered KranthiPakala-MSFT edited

Hi @SachinGupta-8175 ,

Thanks for using this forum and posting your query.

You can follow this video tutorial on how to use the Switch activity: Switch Activity in Azure Data Factory

Sample as below:

99272-image.png

Hope this helps. Do let us know if you have further query.



Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.



image.png (42.5 KiB)
· 2
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.

@KranthiPakala-MSFT Thanks. I was able to solve the problem. Actually i used the Set Variable activity which set the file name coming from ForEach item and based on the fileName I am able to use the Switch activity easily.

Thanks for the response.

-Sachin

0 Votes 0 ·

Hi @SachinGupta-8175,

Glad to know that you were unblocked. Thanks for confirming. If the above information was helpful, please feel free to upvote and/or accept as answer as it could be beneficial to other community members

Have a good day

0 Votes 0 ·