Forum Discussion
MarkShnier__You
Qrew Legend
5 years agoA notification will Trigger when formula fields change, as long as this happens when the record is being edited manually or by API.
Are the formula fields changing when a record is edited? Or through the passage of time or due to the changes in either lookup or summary fields? The latter one will not Trigger a notification.
Can you explain what tables you were actually dealing with and what you were trying to do. Is it something like when all conditions are true on a project to notify the child team members?
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
Are the formula fields changing when a record is edited? Or through the passage of time or due to the changes in either lookup or summary fields? The latter one will not Trigger a notification.
Can you explain what tables you were actually dealing with and what you were trying to do. Is it something like when all conditions are true on a project to notify the child team members?
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
PaulStreit
5 years agoQrew Member
Mark,
The formula field on the parent record is changing through the passage of time and due to changes in summary fields so it will not trigger a notification directly.
The parent table is a table of proposal records. The child table stores a list of approvers, one approver per record. Some approvers must approve before other approvers, so there is a sequence priority field in the approver table that stores the sequence priority which is simply an integer like 1 for the first set of approvers, 2 for the second, etc. There is a a formula checkbox field in the parent proposals table that is set to true when all of the first set of approvers have responded and approved. When the formula checkbox field toggles to true I want to update a trigger field in the parent table proposal approval record that triggers an automation to update a similar trigger field in the child approver records filtered on the sequence priority 2 field which in turn would trigger email notifications to each second sequence priority approver.
So I'm thinking that the way to do this is to have a formula URL field that checks if the formula-checkbox field is true, and if so, places the proposal record into edit mode, updates a trigger text field in the proposal record with the current date/time converted to text, then saves the record by redirecting back to display the proposal table default home screen report. The update of the trigger field would then fire an automation or action that would update a text trigger field with the current date/time converted to text in all sequence priority 2 child approver table records.
I'm assuming that when the automation updates each child approver record that this effectively edits and saves the record which would trigger the email notification. Is this a correct assumption?
I wrote code for the parent proposal record formula-URL field. The [Logic Checks Complete] field is the formula checkbox field that indicates when all sequence priority 1 approvers have approved and that sequence priority 2 approver email notifications can be sent out. Field ID 210 is the proposal record text trigger field that would be updated with the current date/time by the formula-URL field. It doesn't work.
I'm guessing that maybe assuming a formula URL field can execute automatically without a user manually clicking it as a button is the issue, but I don't really know. If that's wrong, is there another way to automatically update the trigger field based on the state of the formula checkbox field?
The formula URL field code is shown below:
//Check to see if sequence priority 1 approvals are complete
IF([Logic Checks Complete]=0, "",
//Edit the current proposal record
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
//Set the automation trigger field (a text field) to the current date/time
& "&_fld_210=" & ToText(Now())
//Redisplay the current proposal record to automatically save the change which should trigger the automation
& "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])
)
I suspect that many QB app developers encounter this situation where they want to trigger an email notification, action, or automation based on a calculation instead of a record add/delete/modify event, so how to address this would likely be useful to the entire community.
Thanks,
Paul
------------------------------
Paul Streit
------------------------------
The formula field on the parent record is changing through the passage of time and due to changes in summary fields so it will not trigger a notification directly.
The parent table is a table of proposal records. The child table stores a list of approvers, one approver per record. Some approvers must approve before other approvers, so there is a sequence priority field in the approver table that stores the sequence priority which is simply an integer like 1 for the first set of approvers, 2 for the second, etc. There is a a formula checkbox field in the parent proposals table that is set to true when all of the first set of approvers have responded and approved. When the formula checkbox field toggles to true I want to update a trigger field in the parent table proposal approval record that triggers an automation to update a similar trigger field in the child approver records filtered on the sequence priority 2 field which in turn would trigger email notifications to each second sequence priority approver.
So I'm thinking that the way to do this is to have a formula URL field that checks if the formula-checkbox field is true, and if so, places the proposal record into edit mode, updates a trigger text field in the proposal record with the current date/time converted to text, then saves the record by redirecting back to display the proposal table default home screen report. The update of the trigger field would then fire an automation or action that would update a text trigger field with the current date/time converted to text in all sequence priority 2 child approver table records.
I'm assuming that when the automation updates each child approver record that this effectively edits and saves the record which would trigger the email notification. Is this a correct assumption?
I wrote code for the parent proposal record formula-URL field. The [Logic Checks Complete] field is the formula checkbox field that indicates when all sequence priority 1 approvers have approved and that sequence priority 2 approver email notifications can be sent out. Field ID 210 is the proposal record text trigger field that would be updated with the current date/time by the formula-URL field. It doesn't work.
I'm guessing that maybe assuming a formula URL field can execute automatically without a user manually clicking it as a button is the issue, but I don't really know. If that's wrong, is there another way to automatically update the trigger field based on the state of the formula checkbox field?
The formula URL field code is shown below:
//Check to see if sequence priority 1 approvals are complete
IF([Logic Checks Complete]=0, "",
//Edit the current proposal record
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
//Set the automation trigger field (a text field) to the current date/time
& "&_fld_210=" & ToText(Now())
//Redisplay the current proposal record to automatically save the change which should trigger the automation
& "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])
)
I suspect that many QB app developers encounter this situation where they want to trigger an email notification, action, or automation based on a calculation instead of a record add/delete/modify event, so how to address this would likely be useful to the entire community.
Thanks,
Paul
------------------------------
Paul Streit
------------------------------
- MarkShnier__You5 years ago
Qrew Legend
OK, I finally understand the question.
The references to APIs are a red herring.This kind of APIs are used for a user to click to cause an edit. Nothing to do with your use case.
Also, there is in fact a user causing a record to be edited to trigger a process, so these summary fields are not in fact changing due to the passage of time. They are changing because a User approved a record and hence edited a record.
So we do in fact have a clear trigger event. The event is an Approval Level 1 record being approved.
Notifications to the Approval Level 2 recipients can be done using an Automation.
We need to have a summary field of the [# of Level 2 Approvers already notified]. That will be the summary count of the # of Level 2 approvals where the [Level 2 Approver date/time Notified] is still blank. This date/time field is the one that will be updated by the Automation to trigger the Notification.
Let's make sure that we have a formula date/time field called [Current Date/time] with a formula of Now() on the Approval records. Also we will need to have the lookup of that parent field for [Ready to Notify Level 2 Approvers].
The Automation will Trigger when a Level 1 Approval is done, subject to the filter that [Ready to Notify Level 2 Approvers] is checked and [# of Level 2 Approvers already notified] =0. Presumably, this would then trigger when the last of the approval level one approvals was done.
The Action once triggered will be to Modify Records in the Approvals table , subject to the filter that they have the same [Related Proposal] as the trigger record.
I believe that the modify records action will be done slow enough that it will be seen as a single record notification update for Notifications. If you get this working but the Notification only fires a multi record change notification which would not be suitable for your needs, let me know and we will just daisy chain one automation to call the next and that will slow it down enough to make individual record change notifications.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------ - PaulStreit5 years agoQrew MemberGood point regarding the approval response as a trigger. This may work. I’ll mess with it and report back. Might be a few days.
Thanks
Paul - PaulStreit5 years agoQrew MemberGood point regarding the approval response as a trigger. This may work. I’ll mess with it and report back. Might be a few days.
Thanks
Paul - PaulStreit5 years agoQrew MemberOK, I'm almost there. I set things up but in the very last step, the automation that sets the trigger checkbox that in turn triggers the email notifications has an issue. The automation is setting the checkbox correctly, but the email notification doesn't trigger off of it. If I manually set the checkbox the email notification triggers. So it appears that when an automation updates a field in a record this is not the same as manually placing the record in edit mode, setting the checkbox, and then saving it.
Any suggestions on what to do here?
Thank you,
Paul
------------------------------
Paul Streit
------------------------------ - MarkShnier__You5 years ago
Qrew Legend
It could be this issue here.
I believe that the modify records action will be done slow enough that it will be seen as a single record notification update for Notifications. If you get this working but the Notification only fires a multi record change notification which would not be suitable for your needs, let me know and we will just daisy chain one automation to call the next and that will slow it down enough to make individual record change notifications.
I suggest that you enable the multi record notification feature of the Notification configuration and set it to come to you. If it comes to you it means that the Notification is firing, but the updates are so fast that Quick Base considers them to be a multi record notification type.
If that is the case, then we need to slow them down so we daisy chain. Create a new field called [Date/Time to Actually trigger Notification]. Rename the old field to be called [Date/Time to Request Notification].
Make a new Automation fire when the [Date/Time to Request Notification] changes to change the field [Date/Time to Actually Trigger Notification] to the current date/time.
Change the Notification to fire on this field [Date/Time to Actually Trigger Notification]
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------ - PaulStreit5 years agoQrew Member
Mark,
You were right, I verified that QB is considering them to be a multi-notification type. I'll try your solution and report back. I didn't see this before because the notifications were set for single notification only, so nothing was going out even though triggering was occurring.
Back soon,
Paul
- PaulStreit5 years agoQrew MemberMark,
The daisy chain automations triggered, and the "request" and "actually" checkboxes are checked, but the email notifications are still being considered by QB as multi-notifications. I even added another step in the daisy chain with a second "request" checkbox between the first "request" checkbox and the "actually" checkbox, including of course the additional automation to set it the additional checkbox, and still the same issue occurs. I'm not getting any automation errors. The sole problem is that QB is considering the record updates as a multi-notification instead of single.
I'm wondering if a pipeline would fix this, to search for the records that need to be triggered, then step through the search results recordset one record at a time to set a trigger checkbox that would trigger the notifications. Thoughts?
Thanks
Paul
------------------------------
Paul Streit
------------------------------ - MarkShnier__You5 years ago
Qrew Legend
Did you set up a separate Automation to listen for the change in the Requested Date/Time and then update the Actually Date/Time?
When I use the word daisy chain I mean that one Automation triggers a separate automation, I am not talking about just an extra action step in an existing automation.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------ - PaulStreit5 years agoQrew MemberYep, separate automation. I understood that you didn’t mean multiple actions in the same automation.
I’m going to try to use a pipeline to trigger the notifications instead of automations. I’m thinking that maybe I can design the pipeline to search for a set of records that meet filter criteria for sending out notifications, then step through each record to set the trigger field for the notification. I’m hoping that the sequential flow in the pipeline will force QB to recognize the notifications as single rather than multi. Don’t know if this will work, but worth at least looking at. I’ll report back.
Thanks
Paul - MarkShnier__You5 years ago
Qrew Legend
I have definitely got it to work with Automations. But it can work with Pipelines too.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------ - PaulStreit5 years agoQrew MemberMark,
The pipeline worked great. It appears the sequential operation of the For…Each loop on the search results allows for each record to be triggered slowly enough that QB treats it as a single notification.
Thanks for your help, your suggestion to check for QB treating the email as a multi-notification pointed me to root cause. I’m not clear why the automation daisy chain didn’t work, but since the pipeline works I’ll go with that.
Thanks!
Paul