I have rule (After saving new content) which loops through a list to create referenced nodes. I am using an approach similar to:
1. After saving new content of type 'story'
2. Create a new entity
Parameter: Entity type: Node, Content type: article, Title: article related to nid..., Author: 2
Provides variables: Created article (article_created)
3. Save entity
Parameter: Entity: [article-created], Force saving immediately: true
4. Set a data value
Parameter: Data: [node:field-myref], Value: [article-created]
The problem I am having now is that only the last 'child' node created is listed on the 'parent' node. Can someone please offer some help as to why only the last node is being referenced?
Rules 7.x-2.7
Entity Reference 7.x-1.1
Thanks for any help!
Comments
Here is a draft that may help
Here is a draft that may help you
Events: After saving new content of type reference field test
Actions:
Provides variables: Created entity 01 (entity_created_01)
Provides variables: Created entity 02 (entity_created_02)
etc.
A loop here would also be a big help.
That is perfect!
Thank you so much for your reply. I was confusing the Add an item to a list step with Set a data value. Everything works perfectly after adding Add an item to a list instead of Set a data value. Everything also works in a loop.
Thanks again for your help!
Glad to be of help.
Glad to be of help.