Email sends before child columns have been updated

Hi,

I've finally found some posts but they all direct me to a link that does not work anymore.

The app needs to send an email when a parent with children has been added or edited, not when deleted, I'd like to make a seperate event for that. Problem is that it sends the email too soon, before children have been updated. Does anyone know how to do this correctly?

Thanks ๐Ÿ˜ƒ

Solved Solved
0 4 155
1 ACCEPTED SOLUTION

Yes. 

When you have a Parent/Child relationship and are adding the Parent row plus its children they are all treated as separate row edits - one for the Parent and one for each child.  When tapping Save, the Parent row is always saved first and any automation triggered by that save will run.  The system doesn't wait for all of the children to be saved as well.  This is by design.

To wait for all rows to be saved, you want to use a flag column to trigger your automation. 

  • Add a column named something like "Send?" Define it as a Y/N type column.
  • Create 2 actions - one that sets [Send?] to TRUE/Yes and second that sets it to FALSE/No
  • Create a 3rd action as a group action named maybe Trigger Email and add the 2 actions from above
  • Modify your Parent Form and attach the group action to the Form Saved behavior (see image below)
  • Update your automation condition to run on Updates when [Send?] = TRUE

Screen Shot 2022-06-22 at 8.14.04 PM.png

The reason for the 2 actions running in the Group is so that flag is set and then immediately reset AS TWO SEPARATE EDITS preventing any row edits happening in between that could cause the automation to trigger again.

 

View solution in original post

4 REPLIES 4

Yes. 

When you have a Parent/Child relationship and are adding the Parent row plus its children they are all treated as separate row edits - one for the Parent and one for each child.  When tapping Save, the Parent row is always saved first and any automation triggered by that save will run.  The system doesn't wait for all of the children to be saved as well.  This is by design.

To wait for all rows to be saved, you want to use a flag column to trigger your automation. 

  • Add a column named something like "Send?" Define it as a Y/N type column.
  • Create 2 actions - one that sets [Send?] to TRUE/Yes and second that sets it to FALSE/No
  • Create a 3rd action as a group action named maybe Trigger Email and add the 2 actions from above
  • Modify your Parent Form and attach the group action to the Form Saved behavior (see image below)
  • Update your automation condition to run on Updates when [Send?] = TRUE

Screen Shot 2022-06-22 at 8.14.04 PM.png

The reason for the 2 actions running in the Group is so that flag is set and then immediately reset AS TWO SEPARATE EDITS preventing any row edits happening in between that could cause the automation to trigger again.

 

Amazing man, thanks for the quick response! I do have some questions for clarification though.

  • Am I presuming right that [send] is a column of the parent? And is it a physical column or virtual column?
  • Are the actions set for the parent, child or both?
  • What are the conditions for setting [send] to TRUE or FALSE? I think this should check weither the childs are done updating, but how to do this?
  • Does your third group action define the condition for the other two actions for [send] and what should the condition be?

I think I understand what you're saying as a mechanism, but I'm not sure how to receive info on if it's completely updated or not and how to link this to the actions.

One tidbit I failed to mention that might explain why this works. 

When you Save, all associated rows are added (or updated) BEFORE any results of actions are applied.  So when you attach an action to the Form Save behavior, it will always execute after all the new rows, including children, have been added.

Answers to Questions:

Physical column and associated actions on the Parent table only is all that is needed.

Conditions to send can be a bit more complicated.  If you want an email sent on every new add and update, as stated in the post above, then no conditions.  Set the Bot to run for "Adds and Updates" and you are all set.

However, if you wanted an email sent only when certain columns change, then this needs more thought. I would still think no conditions in the actions but you might need to split the Bot into one for "Adds Only" and one for "Updates Only" and then set conditions on the Bot itself to meet your goal.

Just let us know your needs and we can help if it is still needed.

I've just done it exactly as you said, and it works exactly as expected. I feel like there should be some more direct way to wait untill children are synced, but thank you for the clarification!

 

Top Labels in this Space