I have a dropdown in a node and the id of the dropdown is "field_b_status". I want to add condition in a rule if the drop down value is equals to one of the value "Complete" then send email.

When i try to add that, i see the error. Data selector field_b_status.value for context Data to compare is invalid. Unable to get variable field_b_status, it is not defined. Please see the screenshot: enter image description here

Can you please help me how to add dropdown "field_b_status" in the condition?


Rules in Drupal 8 doesn't have much flexibility. So in your case, you will do the following to achieve it.

Under Data selector, you will type: {{node.field_b_status.value}} and choose Direct mode instead.

And rest will be similar to your screenshot.


The problem is that field_b_status.value is not a valid value in the data selector. I guarantee that it does NOT show up in the autocomplete for the data selector. Why? Because it is not fully qualified. If you want a field value, you need to also specify the entity that the field belongs to.

The solution is, when using the data selector, choose one of the values listed in the autocomplete for the data selector - DO NOT type in your own value. What you want to select is probably something like node.field_b_status, or node.field_b_status.value, depending on what type of field field_b_status is, whether it's a single-valued or multiple-valued field, and depending on how the event provides the entity context (I assume it's something like "node", but it doesn't have to be ...).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.