Rule to update referenced node after customer completes checkout I've got a rule which fires on "Customer completes checkout".

When it fires I would like to update a field in a node which is related to the one which was "checked out".

The node which is "checked out" has an entity reference field which relates it to another node, of a different content type.

So I have my Rule Event: "Customer completes checkout"
And the condition: "Entity has field" which checks for the entity reference field

Under Actions, I have: "Fetch entity by ID" to fetch the referenced node.
And I have provided a "Variable name" for the Fetched Entity.

I know this much works because I can print the Title of the referenced node as a status message on the site at this point. I can even print the contents of the field that I want to update using the token [the-fetched-node:field-name]

But when I add an Action: "Set Data value" and look for the field to update, the-fecthed-node:field-name is not available.

I can see things like the-fetched-node:body and the-fetched-node:title, but none of the fields of the node seem to be available to Set Data values on...

How can I get access to set the data in my required field?

I'm using the Rules (7.x-2.9) and Ubercart (7.x-3.9) modules.
This question seemms to be a variation of Populate an entity reference field, which suggests a solution like so:


Add Condition: “Entity has field”, checking for your reference field
Add Action: “Fetch entity by id”, supplying your node/user id from another field in the dataset and providing a meaningful name
(Note: This solution implies you get the id by a simple field value in your dataset; you might want to add another condition to register the id first)
Add Action: “Set data value”, which you now can supply your entity object from the step before (hence a name you'll identifiy in the dataset)


Apart from some Rules "Event" you probably need to add to it (related to your "After customer completes checkout"), this should be pretty close to what you're looking for.