Score:0

How to compare node and node_unchanged field values in Drupal 8 Rules?

mo flag

I'm trying to compare the value of a custom field, the unchanged value and the saved value.

Basically... if myfield value was "Not Started" and if myfield value after updating the node is "Pending" then send an email to the node author

The event is "After updating a content item of type". I add a condition for "Entity is of Bundle" and a condition Data Comparison with the specific field and value I want to check. That works fine.

But I would like to compare the node_unchanged value of that field to the saved value. I tried also adding the condition "Entity is of Bundle" for node_unchanged and added a Data Comparison condition for the field's unchanged value. But that does not work. It always evaluates the conditions as False.

Can anyone help with how to use Rules to compare the node_unchanged value to the current value of a custom field?

Thank you.

fr flag
"Can anyone help with how to use Rules to compare the node_unchanged value to the current value of a custom field?" If you export your Rule and post it here we can try to point out what you did wrong. There are many examples of how to do this in the Rules issue queue and the Rules Examples module.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.