Rewrite node reference after create contente by other content

Created on 3 January 2024, 12 months ago
Updated 19 January 2024, 11 months ago

Good morning, I need technical information or to know if the following function is possible.
I created a type B entity from a type A entity. Everything works, including the fields.
I would like to insert the type B entity (the one obtained) as a node reference in a field of the type a entity. so after it was created.
Is there a function that allows me to post-fill the node reference field in content A with the node of type B obtained in the previous action?
Thank you for your collaboration, which has never been lacking

💬 Support request
Status

Fixed

Version

1.1

Component

Documentation

Created by

🇮🇹Italy bigtomfelix

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @bigtomfelix
  • 🇩🇪Germany jurgenhaas Gottmadingen

    If you use the Update content entity event on the node that was created automatically, you can build a model which then also loads the referenced (or referencing) second node and then you have both entities in the context of your model and you can read values from one of them to fill values of the other.

  • 🇮🇹Italy bigtomfelix

    Thank you for the quick response, you are always a great help.
    However, I don't understand how to report the title (or the nid or a token) of the child content in the node reference field of the parent content, since both have been saved.....

  • 🇩🇪Germany jurgenhaas Gottmadingen

    Well, you get the 2 nodes into tokens. One of them in node_a and the other one in node_b. The you can use the action plugins Entity: get field value and Entity: set field value actions to read field values from one entity and write field values into the other.

    Using some conditions will help you define, that all this only gets executed after the "correct" node got saved.

  • 🇮🇹Italy bigtomfelix

    Wow! Works!
    In this regard, I wanted to thank you for the availability you show in accompanying newbies like me in the use of this wonderful project.
    This project is so powerful that beginners like me, when using it, think they have to use complex design formulas when in fact everything is very simple. (when you find out how!!)

  • Status changed to Fixed 12 months ago
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Thank you for your kind word @bigtomfelix and for providing feedback, even the positive one. This is much appreciated and the fuel that keeps us going.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024