Hi @Vinodh247 ,
Thankyou for using Microsoft Q&A platform and thanks for posting your question here.
As I understand your ask, you are trying to compare the output json of Azure function vs look up activity output and fetch out only those records which are matching and filter out the records which are not matchig. Please let me know if my understanding is incorrect.
Since there are two sources and each of the json out of Az function output needs to be compared with each record of lookup activity, you need to use two loops here (ForEach activity) in order to iterate through each of the JSONs and perform the comparison.
Kindly follow these steps:
- Use Foreach after Az function and iterate through the output array using expression:
@activity('Get_Files_SFTP').output.value[0].file_list
- Inside foreach, use execute pipeline activity to call child pipeline. Create parameter inside the child pipeline say , 'FileName' and pass the value as 'item().source_file_name' through the execute pipeline activity.
- In the child pipeline, use look up activity
select * from wallfiles where dataset_id not in (10004,10005,10006)
. Assuming the filename is present in the column called col1 in wallfiles. - Use Foreach activity to iterate through the output of lookup activity using expression:
activity('Lookup1').output.value
- Use filter inside foreach activity, and use the expression:
@not(contains(pipeline().parameters.FileName,item().col1))
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on
or upvote
button whenever the information provided helps you.
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
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators