Send an email based on a column date

  • 18 March 2016
  • 4 replies
  • 34 views

Badge +6

Hi

I'm sure this is easy but I'm new to Nintex and I can't get this to work.

I have a list of employee names and their employment start dates. I want an email sent to me when the current days month and day are equal to any employees start date month and day. For example my employment start date is 3/17/2000, each day the workflow will run and compare todays month and day (3/17) to the employees. If they equal the email will be sent.

Any help would be appreciated.

Thanks

Andrew


4 replies

Badge +6

Hi Andrew,

You would need to iterate through the employee records and load into a collection to run the logic on. Preferably if you could use a Query List action to grab the ID's of the relevant records, you can loop through and trigger the emails.

OR

You could create 2 string variables and use the below format to populate them:

fn-FormatDate(Current Date,MMdd)

fn-FormatDate(StartDate,MMdd)

Then add a RunIf or "Set A Condition" action to compare the two values and only trigger when they are equal. I assume you would have this as a scheduled workflow?

Cheers,

Mark

Badge +4

Andrew,

The simplest way to do this would be to Use a site workflow and schedule it to run once a day.

The workflow would look something like this:

180248_pastedImage_0.png

1) Create two additional columns in the SharePoint List, which will give you month and day from the start date ( you could also do it in the workflow, but I found it easier to do it sharepoint. For month use a calculated column = =TEXT([Start Date],"mm"), and for day, use =TEXT([Start Date],"dd")

2) Query the list to get all IDs.

180251_pastedImage_3.png

3) Now for each ID, query the list to get the Employee Name, Start date, the month and day you calculated above in step 1

180252_pastedImage_4.png

4) Now all you need to do is compare the month and date, using the formatdate inline function in the workflow, and send an email if they match.

180250_pastedImage_2.png

And finally schedule this Site Workflow to run once a day. happy.png

Hope this helps!

Badge +4

Mark Peacock​ Sorry mark, I did not see your reply before I posted mine. Did not mean to repeat what you already described!

Badge +6

Thanks for the detail Prasanna. This worked for me.

Andrew

Reply