Feed Me, skip element I want to skip an element within Feed me after if a condition passes.

So i am listening to the stepBeforeElementMatch event.
Within this event i would have something like this:

if($event-&gt;feedData['status'] == "false") {

    // dont import, skip me
}


I couldn't find any way how i would skip this specific element. I am wondering if there is a way to even skip an element?
Ok, so this is the relevant code in the service processing the feed, where the stepBeforeElementMatch is being called:

        // Fire an 'onStepBeforeElementMatch' event
        if ($this-&gt;hasEventHandlers(self::EVENT_STEP_BEFORE_ELEMENT_MATCH)) {
            $event = new FeedProcessEvent([
                'feed' =&gt; $feed,
                'feedData' =&gt; $feedData,
                'contentData' =&gt; $matchExistingElementData,
            ]);

            $this-&gt;trigger(self::EVENT_STEP_BEFORE_ELEMENT_MATCH, $event);

            if (!$event-&gt;isValid) {
                return;
            }

            // Allow event to modify variables
            $feed = $event-&gt;feed;
            $feedData = $event-&gt;feedData;
            $matchExistingElementData = $event-&gt;contentData;
        }


I have not tested this, but by the looks of it, it should be enough to set the $event-&gt;isValid to false in your code after doing the necessary checks that you want.

Be aware that the $event-&gt;feedData you are working on is an array representation of your feed data (converted from, XML, JSON or whatever). So you need to do your checks accordingly. At this point, Feed Me has not tried to match against potentially existing elements in Craft. Your example code basically assumes there's a field in the feed element with the name status with the value false. If that's not the case, you could do your checks on whatever you want, before a certain date, etc.

But if it is, something like this would be likely to work (again untested):

if($event-&gt;feedData['status'] == "false") {

    $event-&gt;isValid = false;
}



If you're looking to skip based on some Craft element, you'd either need to query for it (basically doing some custom matching), or use an event later in the process (I can help you out there too, but maybe it's easier in your case to skip it already here).