Define how often a workflow should run

I use a Form where the user can define the amount how often a PDF should be printed.
After saving the form, a workflow rule is fired and the PDF ist sent to the Printer’s Email Address.
So if the user set’s the [Amount] to 5, the Workflow should send the PDF 5 times to the printer’s EMail Address.
How could I do that?

I tried several possibilities:

Decrement Count via Workflow
In the Workflow I set a second action after sending the Email: An Action that simply does: [Amount]-1
The idea is: After sending the Email, the Workflow will be triggered again, because the row changed.
Result: Email is sent, [Amount]-1 is done, but no other Email is sent.

Decrement Count via Action
I tried @Steve’s idea Add any number of rows from any row within a table. So by saving the form, an Action is doing [Amount]-1 until [Amount]=1.
The idea is: The Workflow would fire each time the [Amount] changes. So if the user would define [Amount] = 5, then it would fire five times.
Result: The Workflow fires only 2 times: One time when the row is saved and on time when [Amount] = 1. It seems as the changes of [Amount] are happening so fast, that AppSheet doesn’t recognize them.
So instead of going down from 5 - 4 - 3 - 2 - 1, it’s going down from 5 - 1. This is what I can see also in the Spreadsheet.

Using To, CC and BCC
This is the only working solution right now. I set them like this:
To: Printer_Email_Address
CC: IFS([Amount]>1,Printer_Email_Address)
BCC: IFS([Amount]>2,Printer_Email_Address)
Result: This is working, but I can sent the same Workflow only max 3 times.
If I use expressions in “To” like
IFS([Amount]>1,Printer_Email_Address)
IFS([Amount]>2,Printer_Email_Address)
IFS([Amount]>3,Printer_Email_Address)
They will be ignored.

Maybe someone has a Tip for me?

0 6 283
6 REPLIES 6

Hi @Fabian,

Request you to explore if following if it helps in any way. I tried to create a test scenario but I believe I will need a deployed app to test CC and BCC emails in workflow. So the following is untested.

Its it possible that you could create action 2 in the same workflow with reaction defined as 'Email" and TO:, CC: and BCC: defined with expressions you mentioned `IFS([Amount]>4 ,Printer_Email_Address)

If it is working, may be you could send emails upto 6 times. Of course , even if working,there could be some possibly limits on how many workflows can be fired in succession from same app?

Thank you @Suvrutt_Gurjar, yes I think this would work. This would be a Workaround.
But I would like to install a system to “print” as many times as desired.

Hi @Fabian,

I got it. Just in case helps , you may wish to try the following approach based on reference actions between a parent and a child table. Technically this approach can be used for firing any number of reports that one desires.

All the children records (Column name [Counter] in each child record) are set to the identical count from parent column [TargetCount] through reference actions in parent record called +1 all. The maximum that [TargetCount] can be set is equal to number of children records ( 10 in the test app)

Now there is only one workflow rule set on child table to send PDFs as many times as the set [TargetCount] in parent table. The workflow has following condition

AND( [_THISROW_BEFORE].[Counter] <> [_THISROW_AFTER].[Counter], ISNOTBLANK([_THISROW_AFTER].[Counter]), [Counter]>=([_ROWNUMBER]-1 ))

The above expression ensures that the workflow is fired for only those children records where the ( rownumber-1) matches the [Counter] set in child record through reference action. Since child table is only used for firing reports, it is a static table , so row number is used for comparing reports count.

The parent and child table are simple two and three column tables
Parent:
2X_0_0cb9f23cf23503739fcc63f3499906958791d1af.png

Child table

2X_9_9d6926decf0e0cfdc6ce0a4c68824c39f6cb6f31.png

If one wants the limit of reports number to increase to 20 , the number of children records and parent column [Targetount] max value need to be 20.

I tested with of course a tiny report based on parent record but fired from above mentioned workflow in children records with maximum of 10 reports fired in the test app.

Edit: Minor edits to description above.

@Suvrutt_Gurjar Thank you very much. This seems to be a solution. But I will need to read it many times to understand. Still learning…

Hi @Fabian,

Thank you. If you say you are learning, then I must say I can neither read nor write

I have copied the test app to my portfolio. You may wish to copy the test app called “Workflow Reference Actions” at Copy App From Here

I had modified a sample app called 'Reference Actions" to do the needful.

Thank you so much @Suvrutt_Gurjar this is very helpful.

Top Labels in this Space