3

I couldn't find the answer at How to change a field value with a Rules Action?, so instead of necroing that I figured it would be better to ask here.

I have a Rule that, when a Taxonomy Term of a certain type is created, it creates a node of a specific type. I need the Rule to also have actions that edit a few fields of the node - there's a term reference field I need set to the Taxonomy term that triggered the event, and I would also like to set the body to some generic text (either the term name or "Lorem ipsum...").

I see no "Populate a Field" in the Populating a node reference field using PHP in Rules. I don't need the PHP filter, thankfully.

Is this possible?

2

The action you are looking for is "set a data value". You will find that some values are easy to set with this and some are not. Install devel (if you havent already) and use the page array functionality to get the exact details about fields you want to fill in. Also make sure to have tokens/entity tokens available as that will make your life a lot easier for setting values in rules. If the field is multi value then you will need to start using variables, lists and loops to fill the field with data.

  • Sometimes it's not neccessary to use loops, as "add value to list" action is also available. – Miloš Kroulík Aug 10 '15 at 16:26

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.