I have a scenario where I need to either retrieve an existing object or create a new object, and then reference the object later in the flow. See the example below. I have an entity to store a "Client". Each "Client" should only have one record. When the flow starts, I would like to retrieve the "Client" object, if it exists. However, if it doesn't exist, I need to create it. Then, I need to update the association in a different entity. In this example, the "NewClient" variable may not exist. How do I update the association in "NewRecord" to reference the "Client" (regardless if it exists or not)?
asked
Mike Hunsaker
1 answers
2
I would create a Submicroflow to do this.
The submicroflow should try to retrieve the object from the database. If this succeeds then return this object. If it fails, create a new object and return this instead.
In your main microflow call the submicroflow and call the return value Client. You should get either the existing object or a new one as Client.