"InvalidArgumentException: Field field_participant_email is unknown" although it exists We're working on a custom module where we are creating participant content types programatically. We then have some queries to check for where a participant exists.

However although the field field_participant_email‎ exists and is defined, the below code results in the error InvalidArgumentException: Field field_participant_email is unknown.

$query = \Drupal::entityQuery('node');
$query-&gt;condition('type', 'participant');
$query-&gt;condition('field_participant_meeting', $meeting_id);
$query-&gt;condition('field_participant_email‎', $email);
$ids = $query-&gt;execute();


We've tried clearing cache, deleting and re-adding the field to no avail.

Does anyone have any suggestions or experiencing with this type of issue?

Much appreciated.

Update 1

For clarity, I've also checked the following:


checked the spelling of the field
deleted all the content types and reinstalled them through features
tried $query-&gt;condition('field_participant_email‎_value', $email);
tried $query-&gt;condition('field_participant_email‎.value', $email);


Update 2

Looking into the core/lib/Drupal/Core/Entity/Query/QueryInterface.php interface documentation, it seems that adding a condition against a custom field is not supported. This would explain why the error occurs. However I'm yet to find an alternative. I've also experienced the same error when trying to set the value of the field $node-&gt;set('field_participant_email‎', 'name@domain.com');.
The syntax for the field condition(s) is missing a column name (and potentially an operator)

$query-&gt;condition('field_participant_email‎.value', $email, '=');

Here is a useful tutorial on Entity Queries for Drupal 8 I always refer to:

The Drupal 8 version of EntityFieldQuery