Tie microflow to when new association is set/created

What's the easiest way to set a microflow to trigger when a new association is created? I have an object that can be associated with multiple accounts, and I'd like to setup a way to run a microflow to create an email to that account when a new association is made like an event handler. What would be the most efficent method?
3 answers

Hi Jon, You could change the n-n relation between account and project to use an additional entity.

That way you can store additional information in the AccountProject entity as well (eg project role)



If the association is set via a page, you can send the email in an on change event for that reference (set) selector.  If the association is set via a microflow (for example, during a scheduled event or an event handler on a different attribute or on the entity itself), you can generate the desired email as part of the microflow process.

Does either of these 2 cases answer your question?

Hope that helps,



Hi Jon,


Why don't you use a before or after commit microflow. Because in any case, changes to the association need to be commited to the DB by commiting the owner object. In your case since you have multiple accounts per object I am assuming a 1-* association. The before commit microflow needs to be set up on the many side



Project 1 ---- *  Employee

You need a before commit event on the Account.

See the screenshot


Here is the before commit microflow in model share so you can see what is in the actions



I tested this locally and works correctly.


I hope this helps,