Looping through employee emails

Hi guys,

First a little bit of context:
I have a spreadsheet that is fed credential information for onboarding employees. Along with the credentials, their personal emails are provided. The onboarding flow is to send an email to their personal email containing their credentials for first access and tagging the rows that had an email already sent so they won't be read again by the automation.
I currently do it via scripting but wanted to move to the AppSheet platform.

I've been trying many ways to do it, but can't have AppSheet to loop through the emails and send to each employee their corresponding credentials.

What I've done so far is:

โ€ข Imported Data Source from spreadsheet.
โ€ข Created Slice based on presence of Tag, under the condition: ISBLANK([TAG]), thus recovering only rows without the TAG
โ€ข Created Automation Bot with logical flow: Schedule -> Send Email -> Update Data Row (Tag insertion)

Problem is, the Send Email task recovers all emails from email column instead of sending a single email for each row.
I can see that the Schedule action has a ForEachRow setting, thus making it possible to loop through the emails were they sent row by row. For that I would need to select only the top row in each trigger.

I tried selectiong only the first value of all emails or the top row, but haven't succeeded in doing so.
And also tried using [_ThisRow].[Emails], which selects each email value for each row, but then the HTML body variables are not possible to be read.

If possible, how can I achieve the loop?

Thanks!

Solved Solved
0 4 332
1 ACCEPTED SOLUTION


@Makrolon wrote:

What does that look like?


 

Hi @Makrolon 

That means the Table on which your scheduled event is set should be the employee table, such as here (with User instead of Employees in my example):

Aurelien_1-1694493953171.png

 

View solution in original post

4 REPLIES 4

When you are using the scheduled Bot, you don't need to trigger anything. It's triggered by the schedule. When the Bot is triggered (ForEachRowInTable), you need to trigger it from the employees table. Then it will go through the table row by row like looping. Then you can read the email just like [Email] for the "To" field.

Sorry I don't think I follow the part "trigger it from the employees table". What does that look like?


@Makrolon wrote:

What does that look like?


 

Hi @Makrolon 

That means the Table on which your scheduled event is set should be the employee table, such as here (with User instead of Employees in my example):

Aurelien_1-1694493953171.png

 

Hi guys,

I think I was making some kind of silly mistake. It was as straightforward as I thought to be. 

For anyone wondering here how it was set:

Schedule Trigger (ForEachRowinTable on and Querying whole Employees table)
\/
Send Email (Table: Employees table Slice, set to not contain rows with a TAG on them)
\/
Run a data action, set row values (Set TAG in TAG Column)

Thanks for the support.

Top Labels in this Space