Is there a way on Feedme to not import an entry if it doesn't have a match on a specific field?
e.g. If there is no entry that it matches up to, don't import it.
Here's the current code I have:
Event::on(Process::class, Process::EVENT_STEP_BEFORE_ELEMENT_SAVE, function (FeedProcessEvent $event) {
$myField=$event->feedData['myfieldname'];
if ($myField == null){
$event->element->isValid=false;
}
});
The above processes the data getting loaded in. Here's code for processing data after it's parsed.
Event::on(Fields::class, Fields::EVENT_AFTER_PARSE_FIELD, function(FieldEvent $event) {
if ($event->fieldHandle['merchants'] == null) {
$event->isValid=false;
}
});