
So it seems like updating a Rules Action is not what you should try to do (at least not in the current D8 release of the Rules module). Unable to get variable node:field_image, it is not defined. The context Data may only be configured using a selector.īy clicking on the Switch to data selection button (so that the button label changed to Swith to direct input mode), and trying again, I got another error message like so:ĭata selector node:field_image for context Data is invalid. But, that resulted in an error message like so: So I returned to my Rules Action, and started to edit it.
#Drupal rules update field on save update#
So far so good, but next I wanted to update the value to be assigned in my Rules Action, let's say myNiceImage should be updated to myNewestNiceImage. because otherwise I could not have exported it, right? The above export should illustrate that I could perfectly save this. Label: 'Check a field before saving a node' You should then see the exported rule, which should look similar to mine, i.e.: uuid: ab289332-0b45-484f-a1ae-38842620b7e4 Then select the label of your rule as the "Configuration name". Navigate to admin/config/development/configuration/single/export and as "Configuration type" select "Reaction Rule".Navigate to /admin/config/workflow/rules to ensure the rule was really saved (that it does show up there).Then a message will be shown like "Reaction rule ABC has been updated." (ABC = the label you gave to your rule). Click the Save button (to save the rule). And it shows a message like " You have unsaved changes.". You are then returned to the "edit rules reaction" screen (for the rule you are editing.Then click the Save button (to save the Rules Action). And also enter some "Value" (within the "Value" box), eg myNiceImage. Add a Rules Action "Set a data value",and continue like so: click on "Value" (within the "Data" box), and select node:field_image:value (note that for this Data Selector I'm using : (twice), instead of.Then click the Save button (to save the Rules Condition). And also click on "Value" (within the "Field" box), and select field_image. To do so, click on "Value" (within the "Entity" box), and select node. Add a Rules Condition like "Entity has field" (for the field_image field).Use Rules Event "Before saving content".


I'll use content type "Article", which already has a field with machine name " field_image" (out of the D8-box).With that in mind, read on for more details to do a similar experiment with rules 8.x-3.0-alfa1.

is a preview release and is not intended for production sites. I can't hardcode this because it has to be configurable (have to make multiple different forms.Be aware of what's written in comment nr 7 of issue nr 2574691:

Event: my custom continue button is clicked.I have rules and rules-forms-support enabled, I try to make a rule: 'name' field of the node, and puts it in the 'name' field in the formįor the forms I am using the EntityForms-module (which creates a form with the fields of an entity, so users can create new entity objects) and a custom module which allows me to go through the form in multiple steps, a rules event is triggered when the 'continue' button in a form-step is clicked. If it finds a match, it takes the date in the If the filled in tax number allready exists in one of the nodes
#Drupal rules update field on save registration#
The field to compare it to is in another node or entity.Ī registration form for an event => when a user is registrating: check I am looking for a way to populate some fields in an (entity)form (for example name and email) once a client has filled in his tax-number (or another configurable field).
