filter condition

arkiboys 9,556 Reputation points
2022-02-14T10:51:29.083+00:00

In the pipeline I am using a lookup to read a .csv file and then using a filter activity as follows:
Items --> @activity('LookupConfig').output.value
Condition --> @equals(item().FileName, pipeline().parameters.pl_FileName)

Straight after the filter activity, I have a success line going to another activity...

Question:
If the filter does not return the condition correctly , then I want to have a failure.
How do I make the filter to fail if the condition becomes false?
Thanks

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,487 questions
0 comments No comments
{count} votes

Accepted answer
  1. AnnuKumari-MSFT 30,361 Reputation points Microsoft Employee
    2022-02-14T11:59:56.517+00:00

    Hi @arkiboys ,
    As per your ask- 'If the filter does not return the condition correctly , then I want to have a failure.'
    If I understood your requirement correctly, you want to see pipeline failure if the filter activity doesn't meet the condition. That means, if filter activity returns no output, please correct me if I am wrong.

    Also, other approach could be to use IF block instead of Filter activity and specify you condition in If block expression and use Set variable activity in True block and Fail activity inside False block.

    174191-image.png
    174039-image.png

    If the suggested response helped you, please click Accept Answer and kindly upvote the same. If you have extra questions about this answer, please Comment.


1 additional answer

Sort by: Most helpful
  1. AnnuKumari-MSFT 30,361 Reputation points Microsoft Employee
    2022-02-14T11:12:42.873+00:00

    Hi @arkiboys ,
    Thankyou for using Microsoft Q&A platform and posting your query.

    You can use Fail activity , which has been newly introduced in ADF after filter activity to achieve this requirement.

    174121-failactivity.gif

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png 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