Automated Email

Hi, I'm working on a simple timesheet app and having issues with the email automation. Basically, I want automated emails sent with timecard entries for each employee in a specific format as attachment. It's returning field errors from the Doc template when testing. Initially I used "Create" to generate a template which I then added some customization with a table view. See images of the template structure, errors, and table fields. 

The app is not yet deployed.

Any help would be greatly appreciated. 

Screenshot 2023-10-17 at 4.33.03 PM.pngScreenshot 2023-10-17 at 4.26.41 PM.pngScreenshot 2023-10-17 at 4.23.44 PM.pngScreenshot 2023-10-17 at 4.24.04 PM.png

Solved Solved
0 15 357
1 ACCEPTED SOLUTION

The only things I can think of with the information available are

1) to check ForEachRowInTable of the Event definition (although not defining this should raise an error in the definition already and you would have noticed it..)

2) [_computedname] belongs to the Employees table and if the template is based on MyTimecards(slice) then you should use a dereference expression [employee id].[_computedname] 

View solution in original post

15 REPLIES 15

Apparently your bot does not recognize the TimeSheet table judging from the fact that the fields in the template are not found.

Might help the community to help you if you share screen shots of your bot definitions (event, steps.)

Thanks for responding TeeSee1. Sharing screen shots of the bot sequence and settings. 

Screenshot 2023-10-18 at 9.25.51 AM.pngScreenshot 2023-10-18 at 9.27.21 AM.pngScreenshot 2023-10-18 at 9.26.53 AM.png

The only things I can think of with the information available are

1) to check ForEachRowInTable of the Event definition (although not defining this should raise an error in the definition already and you would have noticed it..)

2) [_computedname] belongs to the Employees table and if the template is based on MyTimecards(slice) then you should use a dereference expression [employee id].[_computedname] 

Thanks TeeSee1. Progress made. Just some final tweaks.

Hi TeeSee1, so I'm getting the template filled and test email now, but each time card entry is coming as a separate email. Any idea how to fix that?

that is because the way it is set up, the bot is fired for each record of the Employees table (one email per entry)

If you want to see the whole thing in one email, then you should choose no table in the event, step definitions and start your template by writing your own <<Start: EMPLOYEES(id)>> .... <<End>>. 

Hi @TeeSee1, I tried several Start expressions to no avail.

However, I am now able to receive only the related daily TimeCards (as opposed to all current and past entries) by (1) enabling "ForEachRowInTable" (2) selecting the "My TimeCards (slice)" and (3) entering the Filter Condition "[Date]=TODAY()". They still come as separate attachments though.

Here are few of the failed Start expression attempts. Any advice? Really want to get all the daily entries in a single pdf attachment per employee.

  • <<Start:[My TimeCards]>><<[Row ID].[Job Number]>> <<End>>
  • <<Start:[Related TimeCards]>><<[Row ID].[Job Number]>> <<End>>
  • <<Start:[Related TimeCards].[Row ID]>><<[Job Number]>> <<End>>
  • <<Start:SELECT[Related TimeCards].[Row ID]>><<[Job Number]>> <<End>>

 

  • Screenshot 2023-10-31 at 6.14.42 PM.pngScreenshot 2023-10-31 at 6.08.35 PM.png

Do not use ForEachRowInTable.

For the start expression, try

 

<<START: SELECT(Employees[Employee ID], IN([Employee ID], SELECT(TimeCards[Employee ID],[Date] = TODAY(), TRUE)))>>
<<START: SELECT(TimeCards[Row ID], AND([Date] = TODAY(),[Employee ID] = [_THISROW].[Employee ID]))>>
Daily TimeSheet (Just a title in text)
Employee <<[Employee ID]>>
Date: <<Date]>>
....Your table here with required columns
<<END>>
// here insert a page break from gDoc's Insert menu
<<END>>

 

You need an embedded START expression with Employees data at the top and TimeCards within Employees. (See the help doc).

I am not sure about the slice you mentioned. But the above should work without using any slice though I have not tested the expression myself. There could be a few errors you may need to fix.

Hope this works.

Thanks again for your support @TeeSee1. But for some reason (which I encountered before), I cannot disable the "ForEachRowInTable" without getting an error. No difference if I select any table or no table in the email settings. Not sure why I have to enable it.

Screenshot 2023-10-31 at 10.24.19 PM.png

I have had this happen to me before where I could not get the process and step settings compatible. I do not know exactly what causes this problem but once this happens, you might want to delete it and recreate a new one.

If you want to retain the existing bot just to be on the safe side, simply create another bot without specifying any tables.

It should work like this one. This creates a PDF with multiple pages with one order - order details per page and send the whole thing in one email. So it is similar to what you have one emp and his/her time cards per page and everything (multi pages) in one email.

TeeSee1_5-1698806885211.png

TeeSee1_3-1698806811037.png

TeeSee1_4-1698806848008.png

TeeSee1_2-1698806401739.png

 

Just specify the same template you have already created.

Thanks @TeeSee1. Finally figured it out. Required much simpler FILTER expression and the table config as you mentioned. Cheers! 

Hello!!!

First of all, your automation will never work...

Because only deployed apps with core plan, or superior will run a scheduled bot.

Second, the errors says that your column names are not correct, and your screenshot does not show the whole screen, but as far as I can see, I guess that in your bot event the table is wrong so it is not recognizing the column names, or some silly mistake like that.

Hi peterson, thanks for your comment. You can actually test an email automation if not deployed. Just that the email will go to email of the app owner. I was able to receive the test run now with populated fields. Only one of the fields were incorrect. 

 Just a tip: Have you checked if the location for your template is stored at the right place. And that it uses the right template.  Sometimes you have another copy of the template and the app uses that becaus the path is not correct.... (it may fool you)

Yes, I have checked but would again. Thanks

Top Labels in this Space