The documentation needs examples of comparing the field values of a standard Drupal list field

Created on 21 December 2023, 11 months ago
Updated 2 April 2024, 8 months ago

Problem/Motivation

I need to implement a very simple task: when updating a node, send an email to the user if there is a check mark in the list field.

My list field consists of two values:

  • sitepublish|Show on site
  • sendmail|Send by email

Accordingly, I need to check the value of the second key of my field in the conditions, and if it is "sendmail", then it is TRUE. But how to do it? I've read all the documentation and watched all the videos, but I can't handle this simple task. I've tried a huge bunch of different options, but I can't figure out how to do it, my condition doesn't work. I will be grateful for the examples in the documentation.

I use the classic mode as a model ( https://www.drupal.org/project/eca_cm ), because I'm used to the Rules module. For comparison, I have already tried all the fields. Obviously I need to "Compare a field value with an expected custom value", there I substitute tokens:

Name:
[node:field_question_options:2:value] - because I need exactly the value of the second key in the list. Here I tried to substitute a different value - including just the name of the field, and a token of the form [entity:field_question_options:2:value]

Operator:
equal to

Expected field value:
"sendmail" is the name of the key. I substituted different values here, starting with the key name. Of course, it would be more convenient to select the value I need through the interface.

Comparison type:
value

I spent a huge amount of time and I can't make it work, although the task is trivial, and the selection field is standard. Tell me how to make the comparison correctly and what should be written in the "entity" field?

Steps to reproduce

1) Create a list field with two elements of the form:

  • key1|value1
  • key2|value2

2) In the display settings of the node field make the "key" value, in the settings for displaying the node form make the list appear with ticks
3) Install the ECO module and ECO Classic Modeller, create a model

3) Try to compare the value of the field, and if the check mark is set to point 2, fulfill the condition

My model attachment

User interface changes

It would be nice to get the value of the field of the list whose name I was leading, and be able to select the value I need for comparison through the interface, rather than through direct input. It would also be convenient to write the name of the key, because it is its machine name that we are interested in in terms of comparison.

💬 Support request
Status

Closed: outdated

Version

1.1

Component

Documentation

Created by

🇷🇺Russia mr.pomelov

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mr.pomelov
  • Issue was unassigned.
  • Status changed to Active 11 months ago
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Accordingly, I need to check the value of the second key of my field in the conditions, and if it is "sendmail", then it is TRUE. But how to do it? I've read all the documentation and watched all the videos, but I can't handle this simple task. I've tried a huge bunch of different options, but I can't figure out how to do it, my condition doesn't work. I will be grateful for the examples in the documentation.

    I'd like to help, but the uploaded model comes with too many third-party dependencies that I don't want to download and install just to be able to look into this. Please create an example that lets us reproduce the issue with a fresh Drupal core installation without any additional modules.

    I use the classic mode as a model ( https://www.drupal.org/project/eca_cm ), because I'm used to the Rules module.

    That's not ideal. As the project page states, this is a very limited modeller, and you will never get the full ECA functionality with that. I'd strongly recommend you switch to the modern UI in the BPMN.io modeller. This is especially important when you want us to review your ECA models for support because we can't import models from eca_cm without also going to that limited UI, which doesn't really make sense for us in support, where we need the full functionality available.

    It would be nice to get the value of the field of the list whose name I was leading, and be able to select the value I need for comparison through the interface, rather than through direct input. It would also be convenient to write the name of the key, because it is its machine name that we are interested in in terms of comparison.

    Context-sensitive configuration forms are on the roadmap for ECA 2.0 and beyond.

    A couple of additional tips that I noticed with this issue:

    • uploading screenshots that contain non-English text is difficult, as we can't really get the full value out of them. Would be great if you could switch to an English UI before taking screenshots when you're about to ask an international audience for help.
    • When creating an issue and then editing that issue 4 times afterwards, this will send notification to the maintainers 5 times !!! This can be very disturbing, and you can prevent that by drafting and editing your issue locally before submitting it. This help keeping the noise down for usually pretty busy maintainers.
  • Status changed to Postponed: needs info 11 months ago
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Is this being fixed or do you need more support on it?

  • Status changed to Closed: outdated 8 months ago
  • 🇩🇪Germany jurgenhaas Gottmadingen
Production build 0.71.5 2024