Question

Sending Individualized Emails

  • 19 July 2023
  • 6 replies
  • 78 views

Badge +4

Hi there,

I am struggling to create a site workflow that I think should be fairly simple.

I’m creating a workflow that sends out a monthly email telling each employee (user) how many points they have at the end of the month from our employee reward system 

I have two lists (Users, Point History)

The Users list stores Name, Email, and Employee ID 

The Point History list stores Total Points for each User and Employee ID 

 

I’m trying to make a workflow that Queries both lists, matches the Employee ID from both lists together in order to assign each user total points and then sends out that info in an email.

 

 

Any tips or thoughts on how this can be achieved? 

 

 


6 replies

Userlevel 1
Badge +6

You can use a Query List to fill a collection variable with all the different Employee IDs. If you don’t know, a collection variable is a variable that can contain multiple entries at the same time. You can then use the For Each function to go along the collection variable and send an email to that employee. Like within the “For Each” loop first look up the points history on the other list (use the “set variable” action for this, matching the ID from the Loop with the Employee ID on the list), and then send it by email to that user.

In total you’ll need several variables:

  1. Collection variable that contains all the employee IDs.
  2. “Result stored in” variable to loop along, use the same type as whatever you store your employee ID as, string should typically work
  3. Total points variable to store the Total points for the current employee in and paste into the email you send out
  4. Variable for the email address of the employee if your system doesn’t automatically link it to the user

The For Each function executes actions once for each entry in a collection variable. The entry of a collection variable that is relevant for the current Loop cycle is stored in the “Result stored in” entity that you set when configuring the For Each action. In simple terms, if your collection variable is like Apple;Banana;Cake;Donut;Egg then on the first cycle this “Result stored in” variable will be Apple, on the second cycle it will be Banana, and so on.

Badge +4

Thank you for the response Bob!

 

 

A few initial questions from this. I think the issue that I am running into i that I need to take multiple variables from each list. For example, I need Employee ID, First Name & Email. As of now I have it configured to only bring Back Employee ID. Where would I pull in Email from the same list etc?

 

 

Would you mind mapping this out for me? 

 

 

Thank you so much! 

Userlevel 1
Badge +6

You use a separate “Set variable” Action for each variable, you just pull them in one by one. You set up your variables like this:

Aside from the collection variable, you can use single-line variables for all of them

And then you build your workflow like this:

In each Set Variable action you use a similar method of lookup up the data from your lists, you just store each in a separate variable

Once you have your variables you send the email. You can use the Employee email variable as a destination and paste other variables in the email message.

Userlevel 5
Badge +20

Hi @Edmon 
Did these responses help solve your question? 

Badge +4

You use a separate “Set variable” Action for each variable, you just pull them in one by one. You set up your variables like this:

Aside from the collection variable, you can use single-line variables for all of them

And then you build your workflow like this:

In each Set Variable action you use a similar method of lookup up the data from your lists, you just store each in a separate variable

Once you have your variables you send the email. You can use the Employee email variable as a destination and paste other variables in the email message.

 

 

This is working partially. The issue that I am running into is it is now only sending me my ow info. I put my email into the “To” field to get all of the emails that would be distributed however it is only sending one email containing my info. 

 

It is a loop so I would Assume it would loop through each of the stored Employee IDs

 

Userlevel 1
Badge +6

What does your collection variable look like? You can add a “write to history” action after the List Query and parse the collection variable to the history list. It should list out all the entries stored in the variable separated by a semicolon when you look up the workflow history after running the workflow.

Reply