Help with Templates

Here is what I am trying to do;

  1. Engineers on site make order requests - Requests table - Request Id, Product, Qty etc
  2. When all requests are made, select Completed button which changes Completed Date/Time in the Daily Orders Completed table to now(). I have an Action to do this.
  3. When Action completed a Workflow will send an email with an attachment containing a list of all the Requests for today.

Having problems constructing template. Any help would be most appreciated.

0 15 835
15 REPLIES 15

Lynn
Participant V

Hi @Martina What problems are you having?

Lynn,

this is what I have tried and the errors I am getting.

Orders Complete Noto

Completed Date/Time: <<[Completed Date/Time]>>

<<IF: [Order Details].[Requested Date]=today()>>

Requested Orders

<<Start: [Order Details]>>

Product: <<[Product]>>
Qty: <<[Qty Required]>>
Date Required: <<[Date Required]>>

<>

<>

โ€œErrorsโ€: โ€œError: Workflow rule โ€˜Orders Complete Notoโ€™ action โ€˜Daily Orders Completeโ€™ Attachment template. Expression โ€˜[Order Details].[Requested Date]=today()โ€™ is invalid due to: Error in expression โ€˜[Order Details].[Requested Date]โ€™ : Unable to find column โ€˜Order Detailsโ€™. Error: Workflow rule โ€˜Orders Complete Notoโ€™ action โ€˜Daily Orders Completeโ€™ Attachment template. โ€˜Ifโ€™ expression โ€˜[Order Details].[Requested Date]=today()โ€™ yields a result of type โ€˜โ€™ rather than the expected type โ€˜Yes/Noโ€™. Error: Workflow rule โ€˜Orders Complete Notoโ€™ action โ€˜Daily Orders Completeโ€™ Attachment template. Expression โ€˜[Order Details]โ€™ is invalid due to: Unable to find column โ€˜Order Detailsโ€™. Error: Workflow rule โ€˜Orders Complete Notoโ€™ action โ€˜Daily Orders Completeโ€™ Attachment template. Start expression โ€˜[Order Details]โ€™ should generate a List of Ref values. Please verify that it generates a List and that the contents of the List are Ref values. Ref values should come from the โ€˜Keyโ€™ column of the referenced table. Error: Workflow rule โ€˜Orders Complete Notoโ€™ action โ€˜Daily Orders Completeโ€™ Attachment template โ€˜Ifโ€™ expression โ€˜[Order Details].[Requested Date]=today()โ€™ does not yield a result of type โ€˜Yes/Noโ€™. Error: Workflow rule โ€˜Orders Complete Notoโ€™ action โ€˜Daily Orders Completeโ€™ Body template. Expression โ€˜[Order Details].[Requested Date]=today()โ€™ is invalid due to: Error in expression โ€˜[Order Details].[Requested Date]โ€™ : Unable to find column โ€˜Order Detailsโ€™. Error: Workflow rule โ€˜Orders Complete Notoโ€™ action โ€˜Daily Orders Completeโ€™ Body template. โ€˜Ifโ€™ expression โ€˜[Order Details].[Requested Date]=today()โ€™ yields a result of type โ€˜โ€™ rather than the expected type โ€˜Yes/Noโ€™. Error: Workflow rule โ€˜Orders Complete Notoโ€™ action โ€˜Daily Orders Completeโ€™ Body template โ€˜Ifโ€™ expression โ€˜[Order Details].[Requested Date]=today()โ€™ does not yield a result of type โ€˜Yes/Noโ€™.โ€,

Lynn
Participant V

Hi @Martina Have you had a look at this sample app. it creates a daily report from a slice.
https://www.appsheet.com/samples/An-app-to-help-foremen-keep-a-daily-log-for-construction-projects?a...

Thanks Lynn but I need to send the email once the Action is triggered - in a Workflow, not as a scheduled Report.

I donโ€™t think its possible to do what I am trying to do.
Will just have to send an email to inform the buyer that Daily Requests are Complete.
The buyer can then go and View Slice of Daily Requests.

I can set up a workflow to send an email every time a request is made ([Requested Date] changes to today) but that could trigger 100 emails. I want to send 1 email listing all the Requests whenever the engineers are finished making their requests for the day.

Hi Martina,

I would be surprised if what you are trying to do is impossible.

I am having trouble understanding how your tables are related to one another.

It sounds like you want the workflow rule to be triggered when you set field โ€œCompleted Date/Timeโ€ in table โ€œDaily Orders Completedโ€ to NOW(). Is that correct?

It sounds like you want to list the related records in the โ€œRequestsโ€ table when a record in the โ€œDaily Orders Completedโ€ record is updated. Is that correct?

I am not clear how the โ€œDaily Orders Completedโ€ table and the โ€œRequestsโ€ table are related.
In other word, I am not clear how the workflow rule can get from the just updated โ€œDaily Orders Completedโ€ record to the related records in the โ€œRequestsโ€ table.

Hi Phil, yes thatโ€™s my problem-they are not related.

I want to create a pdf to email of all the records in the Requests table with Date Requested=today() once all requests are done for the day- Engineer would trigger this.

I donโ€™t want to use a report as the completed time will be different every day and buyer needs notification as soon as requests are all completed.

Regards

Martina Hawkins

Computer Systems Analyst

Hi Martina,

You can do that with an event triggered workflow.
The change to set file Date Requested=today() would be the triggering event.
The rule would run immediately once the update occurred.
The email would be sent at once.

I thought your problem was in writing a template that lists the needed records.
Hence my questions.

I think Lynnโ€™s response was trying to direct you to a sample template that might help you in authoring a template. She was not saying you need to use a scheduled Report. Template authoring is largely the same whether you are creating a workflow rule or a report.

That sends an email for every row. I want to wait until all rows have been created for the day and send all rows that have a Date Requested= today() in 1 email.

Regards

Martina Hawkins

Computer Systems Analyst

Hi Martina,

Based on your original post, I thought it was possible to know when all rows have been created for the day. You wrote:

โ€œWhen all requests are made, select Completed button which changes Completed Date/Time in the Daily Orders Completed table to now(). I have an Action to do this.โ€

I took this to mean:

  1. That the user would click the โ€œCompletedโ€ button after all request are completed for the day.
  2. When this button is clicked, it invokes an action that updates the โ€œCompleted Date/Timeโ€ field in the โ€œDaily Orders Completedโ€ table.
  3. This will result in an update to the โ€œDaily Orders Completedโ€ table that is sent to the server.

If my understanding is correct, then this update only occurs when all rows are present. If so, the update could trigger a workflow rule that sends one email that includes all of the updates.

That is correct but the Daily Orders Completed table only has one column-Date/Time Completed. It has no relation to the Requests table.
The workflow is built off the Daily Orders Completed change event of Date/Time Completed but the issue is how do I select all the records from the Requests table in the template. I tried above and got errors

Try

<<Start: Filter(Order Details, [Requested Date]=Today()>>

Product: <<[Product]>>
Qty: <<[Qty Required]>>
Date Required: <<[Date Required]>>

<< End >>

Thank You Phil so much. That is exactly what I need.

Just one more question Phil. Do you know if emails come through more quickly once an App is deployed? Taking about 15 mins at the minute.

Whether the app is deployed or not has no effect on how quickly the email is created or sent to the email service.

I would start by checking Audit History to see:

  1. When the email was generated. The times are in GMT. If you are measuring based on the email arrival time in your mailbox, other factors may be at work.
  2. The performance information in the Audit History. If a computation is taking a long time, you will see that.

See topic " Why isnโ€™t my workflow rule working?" in this article https://help.appsheet.com/behavior/workflow-sending-email/troubleshooting-workflow-emails

Top Labels in this Space