Hello all. I'm quite new to Appsheet, but no...

(Jonathan Morgan-Jones) #1

Hello all.

I’m quite new to Appsheet, but not new to development. I’m trying to solve a problem on behalf of another Appsheet user.

The app sends out emails to more than one recipient based on the contents of various fields within a single row of one table (Orders). The workflow works well for new or deleted records, but causes a problem for updates.

Each field update has the effect of triggering the email updates, meaning that several duplicate emails may be sent for a sequence of updates on a single row.

Is there/can there be a new workflow trigger of ‘lost row focus’ - i.e. The action triggers when the app user starts making changes to a different row (record)?

Otherwise, can someone suggest how I can cause a single action to occur as a result of multiple field updates to a row (record)?

Thanks.

(Suvrutt Gurjar) #2

Hi @Jonathan Morgan-Jones,

Please explore if following helps

  1. Under workflow rule panel (Under option Behavior /workflow settings,’ Update Event"

option is set to your requirement,“Update Only” or “Adds and Updates” or as required by the app.

  1. Also under workflow rule “Condition” option is set as per your requirement of multiple field updates. You can write an expression to ensure various fields are updated as per your app requirement.
(Jonathan Morgan-Jones) #3

Thank you for this answer. What you describe is the current situation, it’s not what I need :frowning: - The ‘Update event’ is set to UPDATES_ONLY and there are various fields that have conditions.

However, I need the event(s) to trigger ONCE after ALL the updates are completed or when then row (record) has ‘lost focus’. This is due to the conditions being dependant upon a combination of field updates, that may still be ‘true’ under the conditions for different events.

What’s being triggered are 3 emails based on various criteria, that may send an email to a customer, haulier or supplier. Changing field A may trigger the email(s), as may a change to field B - Duplicate emails this time, the same for field C, etc…

I need to be able to trigger the email(s) once, when all the field changes have been completed, so it’s only possible to send the email(s) once.

From what I understand of Appsheet at the moment, I have no way no knowing when the ‘last’ field update was made. In this particular case there may be one or more field changes per record update event, nor can I see how to trigger a time delayed event to check if the ‘last’ change was X minutes ago. The alternative would be a batch process to send the emails for all records that meet the criteria on, say, an hourly basis.

(Philip Garrett) #4

@Jonathan Morgan-Jones

Currently event triggered workflow rules are triggered each time the client does a sync with the server. If you are performing a series of sync operations for the same record, there is no way to signify that this is the last sync in the sequence of syncs.

I can only think of two alternatives.

  1. The first alternative is to devise a Condition expression that suppresses the workflow rule until the record is in its “final” state. I am not sure from your description if this is possible. Is there any combination of values that you can check to determine if the record is in its “final” state?

You have two tools that might be helpful in doing this.

a. One is to compare the before and after values of your updated fields. Workflow rules are capable of doing that.

b. The other is adding one or more ChangeTimestamps fields that reflect when either a specific field or all fields have changed value. When you define a ChangeTimestamp field you can specify whether it is updated when only specific fields in the record are changed or whether it is updated when any field in the record is changed.

Even these tools may not be enough to write a Condition expression that is only true when the record is in its “final” state.

  1. The second alternative is to use a Report (aka Scheduled) workflow rule that fires at a regular interval. We do not currently offer a direct way to fire a rule on an hourly basis. Our finest grain schedule interval is a daily rule that fires at a particular time. You can achieve finer grain rules by defining a set of identical rules which each fire daily but at different hours of the day.

As you suggested, you might combine these with a ChangeTimestamp field that indicates when the record was last updated. You could then create a “Recently Updated” slice that included records that have been updated in the last hour but excluded those that had been updated too recently. Your Report workflow rule could then send email for each the records in the “Recently Updated” slice.

(Jonathan Morgan-Jones) #5

@Philip_Garrett_Appsh I’ve learnt a bit more ‘Appsheet’ since yesterday and discovered the events I’m looking for in the UX section. Simply by adding the email send trigger (Action) to the ‘Save’ Action for the edit form, I should be able to get the result I’m looking for. I’ll let you all know, either way. View Events appsheethelp.zendesk.com

(Jonathan Morgan-Jones) #6

Is there documentation for what is happening when UX events are ‘automatic’? e.g. What is happening when ‘form saved’ is ‘auto’?

I ask because I want to use this event for my own action + save the form and I need to know what action to select (Add or Edit or something not listed).

(Suvrutt Gurjar) #7

Hi @Jonathan Morgan-Jones,

Please explore if following helps

  1. Under workflow rule panel (Under option Behavior /workflow settings,’ Update Event"

option is set to your requirement,“Update Only” or “Adds and Updates” or as required by the app.

  1. Also under workflow rule “Condition” option is set as per your requirement of multiple field updates. You can write an expression to ensure various fields are updated as per your app requirement.
(Jonathan Morgan-Jones) #8

Thank you for this answer. What you describe is the current situation, it’s not what I need :frowning: - The ‘Update event’ is set to UPDATES_ONLY and there are various fields that have conditions.

However, I need the event(s) to trigger ONCE after ALL the updates are completed or when then row (record) has ‘lost focus’. This is due to the conditions being dependant upon a combination of field updates, that may still be ‘true’ under the conditions for different events.

What’s being triggered are 3 emails based on various criteria, that may send an email to a customer, haulier or supplier. Changing field A may trigger the email(s), as may a change to field B - Duplicate emails this time, the same for field C, etc…

I need to be able to trigger the email(s) once, when all the field changes have been completed, so it’s only possible to send the email(s) once.

From what I understand of Appsheet at the moment, I have no way no knowing when the ‘last’ field update was made. In this particular case there may be one or more field changes per record update event, nor can I see how to trigger a time delayed event to check if the ‘last’ change was X minutes ago. The alternative would be a batch process to send the emails for all records that meet the criteria on, say, an hourly basis.

(Philip Garrett) #9

@Jonathan Morgan-Jones

Currently event triggered workflow rules are triggered each time the client does a sync with the server. If you are performing a series of sync operations for the same record, there is no way to signify that this is the last sync in the sequence of syncs.

I can only think of two alternatives.

  1. The first alternative is to devise a Condition expression that suppresses the workflow rule until the record is in its “final” state. I am not sure from your description if this is possible. Is there any combination of values that you can check to determine if the record is in its “final” state?

You have two tools that might be helpful in doing this.

a. One is to compare the before and after values of your updated fields. Workflow rules are capable of doing that.

b. The other is adding one or more ChangeTimestamps fields that reflect when either a specific field or all fields have changed value. When you define a ChangeTimestamp field you can specify whether it is updated when only specific fields in the record are changed or whether it is updated when any field in the record is changed.

Even these tools may not be enough to write a Condition expression that is only true when the record is in its “final” state.

  1. The second alternative is to use a Report (aka Scheduled) workflow rule that fires at a regular interval. We do not currently offer a direct way to fire a rule on an hourly basis. Our finest grain schedule interval is a daily rule that fires at a particular time. You can achieve finer grain rules by defining a set of identical rules which each fire daily but at different hours of the day.

As you suggested, you might combine these with a ChangeTimestamp field that indicates when the record was last updated. You could then create a “Recently Updated” slice that included records that have been updated in the last hour but excluded those that had been updated too recently. Your Report workflow rule could then send email for each the records in the “Recently Updated” slice.

(Jonathan Morgan-Jones) #10

@Philip_Garrett_Appsh I’ve learnt a bit more ‘Appsheet’ since yesterday and discovered the events I’m looking for in the UX section. Simply by adding the email send trigger (Action) to the ‘Save’ Action for the edit form, I should be able to get the result I’m looking for. I’ll let you all know, either way. View Events appsheethelp.zendesk.com

(Jonathan Morgan-Jones) #11

Is there documentation for what is happening when UX events are ‘automatic’? e.g. What is happening when ‘form saved’ is ‘auto’?

I ask because I want to use this event for my own action + save the form and I need to know what action to select (Add or Edit or something not listed).