ADF Filter Activity NOT filtering

Mike Kiser 1,531 Reputation points
2021-04-14T03:31:19.19+00:00

Hello! @Nasreen Akter @MartinJaffer-MSFT

I have a Filter activity after a Lookup Activity (which is successfully bringing back data from a SQL Server DB Table); I want to send the filtered data to the ForEach for if an Employee is NOT "Inactive"....as shown below. My Filter Condition is: @startswith(item().status,'Inactive')

I have in my first row of data the Status = 'Inactive'; however the employee data in the first row of the Inactive filter is still being passed to the ForEach Activity; therefore something is incorrect. Should I have all my Filters inside the ForEach instead of before it?

Any suggestions will be greatly appreciated! Thanks! Mike Kiser

87528-image.png

87591-screenshot-2021-04-13-222747.jpg

87527-screenshot-2021-04-13-221657.jpg

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

2 answers

Sort by: Most helpful
  1. Vaibhav Chaudhari 38,576 Reputation points
    2021-04-14T04:52:14.317+00:00

    If you just want to process records with Status active, then try something like

    @contains(item().status,'Active')
    

    Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav


  2. MartinJaffer-MSFT 26,021 Reputation points
    2021-04-14T15:11:47.747+00:00

    @Mike Kiser

    There is a "not" function. You can use this to invert the results of the contains.

     @not(contains(item().status,'Inactive'))