I need my workflow to iterate through a list and each week send emails

  • 4 October 2018
  • 4 replies
  • 165 views

Badge +6

I have been trying so many different options for this list. Each week I need Monday and Wednesday emails to be sent. I want to start this manually and let it run through the end of November. If I set today's date variable (vartoday using "Use date when action is executed") and have the Run if = varToday = Monday Reminder Date  (each Monday the workflow runs through the Loop. Or will varToday ONLY remain as the date the workflow is kicked-off? I was assuming earlier each day the workflow runs the varToday will represent that day's date, but now seeing "Use date when action is executed" that seems like maybe it will ONLY remain Monday, October 7, 2018. Next week will the value be October 14, 2018? If so, it should work fine, but if not I'll have to use For Each and a query list I think. 

 

workflow O365 variable today's date


4 replies

Badge +5

Hi Mark LeGault‌,

You mention you created a variable "varToday"? To verify what is the value being stored in the variable I would suggest adding a workflow action, log to history, after you set a value to the variable, varToday. Then compare if the variable is different or same as the date when manually starting a workflow. Depending on your logic, this variable may not always be the same date as start date of a workflow if there are other workflow actions configured that may cause a delay such as a user tasked action before defining a value to the variable.

You could have this handled by creating a Site Workflow that is scheduled daily. Since the workflow is scheduled daily, you would use the date of when the workflow was started and match it to the values of the Reminder fields (Monday Reminder Date, Wednesday Reminder Date, etc). If dates are equal, send email notification tailored for the Monday Reminder vice versa for the Wednesday Reminder. 

Badge +6

Thank you, Tobias. I will give this a try. I appreciate the info!

Badge +9
Hi Casey,

This is a side note and may not be important, depending on the volume of items that the list will ever contain, it may be better to use a query to find the matching items, rather that iterating all items if that was the plan.

Typically querying (using Query List action for example) is much more efficient and on large lists it can help reduce the chances that SharePoint will throttle the workflow etc.

Callum
Badge +11
Hello casey. Did you get this to work. Looking at this previously in Nintex 365, and looked overly complicated, but not so in PowerAutomate. Just wondering if Nintex can do this now equally simply.

Reply