New Bug Encountered: Action not firing consistently

Hi everyone, I have an issue with an action not firing consistently causing missed customer quotes from going out for my client. The issue has been reported and confirmed by AppSheet but theyโ€™ve advised โ€œWeโ€™re going to add more logging, but without the ability to consistently reproduce the error, thereโ€™s not a lot more we can do.โ€

I really need to get a solution pulled together for this client as theyโ€™re losing faith in the system. Is there any other way you can think of to set the value of a column after it has been saved in order to trigger a workflow?

Any help would be greatly appreciated! Thanks

0 22 918
22 REPLIES 22

You need to set a columns value in order to trigger a workflow? So you want the workflow to happen when a record is edited? Can you describe your goal a bit better, Iโ€™m afraid thereโ€™s not much to suggest without knowing more details?

Hi Marc, I have a quoting tool configured as below:

1.I have an action that will change the Quote Stage to In Process On save.
2.An UPDATES ONLY workflow is triggered when the Quote Stage is set to In Process. It sends an email with the quote content and then completes a number of other updates to the row after the email is sent.

When I initially set the workflow to run immediately after the quote was saved (ADDS ONLY) with no โ€œIn Processโ€ condition, the system sent the email before the associated Quote Details (products data) was completely saved so users received a blank quote.

Daisy

I had a similar situation before.

But my approach was slightly different. I had a tracker table for all the statusesโ€ฆ

My action would simply ADD a new row to that tracker tableโ€ฆ

I never liked โ€˜updateโ€™ workflow triggersโ€ฆ they are inconsistent.

But ADDING rows to tables always seems to trigger workflows consistently they seem to become congested and workflow either never execute or burst out 30min later out of nowhere.

EDIT: I realize youโ€™ll have to really re-do your PDF code to accommodate the fact that youโ€™re doing it from another table โ€ฆ but i guess itโ€™s a small price to pay if the workflows trigger consistentlyโ€ฆ

A million thanks Alex and I see what you mean. I do have an โ€œActivityโ€ table in place to capture when the Quote Stage was made and added a few more stages to track for this issue but I want to make sure Iโ€™ve configured this like you mentioned above since my actions seem to be failing.

*The user inputs the Quote Header (parent) with Details (child), then presses Save
*I have an On Save action on the Quote Header that runs a grouped action.
*The grouped action, 1) creates the activity record to table โ€œActivityโ€, 2) updates the Quote Stage field in Quote Header to โ€œIn Processโ€ and then 3) *creates another activity record for the new stage โ€œIn processโ€

I implemented this yesterday morning and have been monitoring client records as theyโ€™re posted. The activity tracking would tell me which actions of the grouped action didnโ€™t process - I thought it just didnโ€™t like the stage change. Since thereโ€™s no data in the activity tracking table at all for some of the quotes it appears the entire action never fired at all.

Is this how your scenario is set?

@Daisy_Ramirez

So hereโ€™s how i would handle this:

3 Tables:
Quote MASTER (for the quote header info)
Quote DETAIL (for the quote line items data)
Quote STATUS (linked to the MASTER table with an ENUM field called STATUS โ€ฆ which would include all the statuses you want to track that MASTER entry with)

Step 1) CREATE QUOTE > Workflow 1 >> Triggers on the addition of NEW ROW to (letโ€™s call it) QUOTE MASTER table.

Note: At this point i would have a one VC with an if statement: IF(ISBLANK(Related Quote STATUSs),โ€œNewโ€,MAXROW(โ€œQuote STATUSโ€,โ€œTimestampโ€,([QUOTESTATUS_UID] = [_THISROW].[QUOTEMASTER_UID]))

That way I can create Slices โ€ฆ do reporting etc etc on that Master QUOTEโ€ฆ Based on a quoteโ€™s status.

Needless to say - weโ€™re going to be using the addition of the QUOTE Master itself as the triggerโ€ฆ (If you want to fire out PDFs at this stage be careful thoughโ€ฆ this might have a wierd effect if you make the QUOTEMASTER_UID ref column a โ€˜Part ofโ€™ the Quote MASTER tableโ€ฆ the sequence of events will change to A) New Master Entry B) Trigger C) Addition of DETAILSโ€ฆ Your PDF will be missing the children. Thereโ€™s ways to handle thisโ€ฆ)

Step 2) Move Quote MASTER to โ€˜In Progressโ€™ > Create action that adds a new row (hereโ€™s your trigger!!) to another table based on the data from this table.

Note: The action will simply add a new row to our STATUS table causing a Trigger and instantly changing the status of the Quote MASTER entry since we now have that VC in place.

**Step 3) ** Rinse and repeat for other statusesโ€ฆ

Sorry for the ramble - hope the above makes some sense.

Hi Jon, hope all is well. I configured the scenario above and although the add row to Activity table action worked, it looks like my CREATE QUOTE workflow (email_quote_prospect) did not fire based on the audit trail. Could it be my VC formula? My guess is the system didnโ€™t have time to calculate the vc formula and the Condition was therefore false?

*** Audit Trail**

*** Quote Master workflow for Add Only**

*** VC Formula =**

IF(ISBLANK(Related Activitys),
โ€œPendingโ€,
LOOKUP(MAXROW(โ€œActivityโ€,โ€œDate Time Enteredโ€,AND([Reference] = [_THISROW].[quote_id],[Type]=โ€œQuoteโ€)),โ€œActivityโ€,โ€œactivity_idโ€,โ€œStatusโ€))

Table Cross References:
Quote MASTER = Quote Header
Quote DETAIL = Quote Detail
Quote STATUS = Activity

I think weโ€™re onto something here. Thanks Jon

Hey @Daisy_Ramirez

The basic idea is that Workflows need to be triggered based on the mere fact that thereโ€™s a new row in XYZ Table - not based on a change in a VC.

So, in essence we end up with having two slightly different workflowsโ€ฆ The template should in theory stay the sameโ€ฆ since youโ€™re basing your whole report on [quote_id] key column.

Workflow 1 - โ€œOnly New Quotesโ€ - we use the [quote_id] from the new entry in the Quote MASTER (Quote Header) table โ€“ Should trigger on ADDS_ONLY

Workflow 2 - โ€œQuote Updatesโ€ - we use the [quote_id] from the new entry in the Quote STATUS (Activity) table. โ€“ Should trigger on ADDS_ONLY

Hope this makes sense and iโ€™m not missing any beats anywhere

Thanks Jon, I was able to get the Workflow 1 email (in your note above) to fire successfully and have implemented it with the client. Two out of 9 new records did not generate a quote as expected.

Workflow1 for new quotes only, triggers on ADDS_ONLY and fires when thereโ€™s a new record in the Activity (STATUS) table.

Workflow2 for updates only, triggers on UPDATES_ONLY and fires when the โ€œSend Quoteโ€ field is set to yes.

I was hoping actions that create new records to another table were more reliable than the field update actions I originally started with. It appears the create_activity record action at On Save of the form, didnโ€™t fire so a record was never posted to the Activity table to fire workflow 1.

Hi Alex, Iโ€™ve been working through your scenario here and have a question about the actual email template.

Based on your example above,

  • My โ€œtrackerโ€ table is called โ€œActivityโ€.
  • Iโ€™m currently posting a record to the Activity table from my Quote Header table when a user saves the form (On Save)
  • I have a workflow that fires when a record is added to the Activity table and itโ€™s set to generate the email template so the workflow is based on the Activity table now vs. the Quote Header table.

Iโ€™m having trouble with my email template:

Hereโ€™s the Start Expression of the email template:

Hereโ€™s the error Iโ€™m getting:

Thoughts?

If the action only sets the column value on a form save, you could instead try to set an Initial Value and Reset on Edit formula to suit your needs.

Or another option would be to setup the workflow to trigger off of some other change (something else that is changing at the same time?), and have the workflow include the data change action you already have.

Thanks Marc

One way is if you add an action into your Parent tableโ€™s form view. When you save the parent & child records, the action will be the last one of this process. Then the email/workflow will have all saved child records as well.

Sorry Aleksi, just want to make sure I understand. Do mean create an On Save action for the Quote Detail (child) form that changes the Quote Header (parent) Quote Stage field to โ€œIn Processโ€?

Hi Aleksi, can you help to clarify your idea on this one? The action I currently have saved on the Parents form view is the update field to โ€œIn processโ€. Are you saying I should a grouped action and include another action with the In Process one - like โ€œgo to another formโ€. And in the grouped action run the go to another form first and then run the In process action?

A million thanks!

@Daisy_Ramirez Please check the sample app โ€œParent Workflowโ€ from https://www.appsheet.com/portfolio/531778

Thanks Aleksi. Sorry for not understanding but how does it differ from updating the field to โ€œIn Processโ€? How are we ensuring the child table records are saved? I donโ€™t see an action associated with the child table.

The action is in parent record.

Ok yes, I thought there would be another for the child. This is similar to the action I have setup already except that its updating the Quote Stage field to InProcess of the parent table vs. PDF_SENT to Now() but my email doesnโ€™t include the child records. How would this ensure the child records are saved? Just want to understand.

The action in parent table is triggered after all child records are saved.

Ah ok. So it appears Iโ€™m in a sense doing the same by updating the Quote Stage field to "In Process. Youโ€™d probably have the same issue with inconsistency if the PDF_Sent field just didnโ€™t get updated.

Thanks Aleksi, Iโ€™ll keep at it

Youโ€™re welcome

Hi Jon, aha! I get what you and Alex are doing here. Iโ€™d like to test this over the weekend when the client is out so Iโ€™ll probably run through this a few times and reach out if thereโ€™s a question.

I thinks this might be it!

Thanks Jon and Alex!

Top Labels in this Space