0

I have created a RULES loop. It loops over a set of flagged nodes (using the action 'Fetch Node flagged by user') and attempts to create a new node for each flagged node. Finally, the new node is linked to its related 'loop' node via entity reference.

My problem is: The action that creates the new node ('Create a new entity', which is called within the loop) assigns the new node to a static variable name (mine is: entity_created). Because of this, the loop only creates one new node and only saves data from the final loop node into it.

Is there a way to either create this variable dynamically or is there a way to reset the value of entity_created so that it can be used to create multiple nodes?

1 Answer 1

0

Create a sub-rule which does the node creation and call it from within the loop. This should provide enough separation to keep the nodes from interfering with each other. Also, use "Save entity" action to lock the new nodes in place during the loop, instead of at the end of the rule.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.