I have a node with a entity reference field with multiple values.

How can I add an entity reference to a this list with rules?


You didn't post your setup and where you want to trigger the rule, but you would do this with PHP code added as a rule action:

$node = node_load(YOUR_NODE_ID);
$node->field_you_want_to_save[]['target_id'] = NEW_ENTITY_REFERENCE_ID;
| improve this answer | |
  • You're welcome :) if this solved your question, click on the green check sign right next to the answer to accept it as a solution. – Aram Boyajyan Sep 18 '12 at 17:40

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.