2

We can create new nodes using Rules Actions. However, when creating new nodes, if we want to set the fields' values for the new node, there seems to be no way to do that in Rules.

E.g. I want to create a new node, using Rules Action, which has a field field_age. And I want to set it to some value depending upon the event. How do I do this?

Can this be done using Rules?

  • 1
    Can you clarify what do you mean by "define the fields values for the new node"? – Aram Boyajyan Mar 6 '16 at 9:05
  • @AramBoyajyan: I meant settings a field's value. I've modified the question for more clarity. – shivams Mar 6 '16 at 9:16
3

Yes you can.

Add action: Create a new entity >> select your content type

Add action: Set A Data Value and for data selector use, for example if want to set a value for the body then you use: entity-created:body

In your case entity-created:field-age

Add action: Save Entity >> entity-created

  • Oh... Yes... There it is. How could I miss that! Thanks a lot. This should solve the problem. – shivams Mar 6 '16 at 9:16

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.