Solved

Run workflow based on date trigger

  • 14 February 2019
  • 6 replies
  • 411 views

Badge +4

SOLUTION and SAMPLE is in the very last post

 

Hey there,

I am trying to trigger a workflow in Nintex Workflow for Office 365 based on a date field called Form Completion Date. The client is requiring that a trigger runs 1 day before the Form Completion Date value to send an email to the requestor to complete the form.

 

I cannot work out how to run this trigger based on this field.

 

I do apologise if my question has been answered but I've searched the forums that relate to my issue exactly and cannot find any discussion on it. I am also quite new to Nintex so any advice of being pushed into the right direction is appreciated or pointed to the post where this has been answered already.

icon

Best answer by callum 20 February 2019, 05:41

View original

6 replies

Badge +9

Hey Xenolcon,

 

Rather than trying to trigger on the item (you need an event for that to happen, such as Item Modified or Created), I would try somethign like the following:

 

  •  (Optionally) Add a field to your item called "Reminder Sent"
  •  Schedule a Site Workflow to run daily
  •  In the workflow, use the Query List to find all items in your list where
    •  Completion date <= Today's date + 1 day (Use the Date Add action) - Be careful with the time component too if there is one, you may need to tweak this logic.
    •  (Optionally) "Reminder Sent" = false
  • Use a for each loop to then work with each item found, and send the reminder email.
  •  If you created the "Reminder Sent" field, then after you send each reminder email, set the value of this to 'True'

 

This way each day the workflow will run itself and send reminders for any items that need it. Additionally you will have the protection that if for some reason your workflow fails on a day, you can re-run it later and it will send reminders for all, or if you run it twice it won't re-send emails (since the field is set to false).

 

 

Badge +4

 

 

 

Hey Callum,

thank you so much for your response and taking the time to help me out.

 

I am trying to follow your steps and I've added the column you recommended. That was actually a really good idea.

 

I've tried following your instructions and it's probably because I am so new to this but I can't see a way to configure the variables. Do I need to be adding the Set Workflow Variable component into the workflow. Is there a screenshots you could potentially provide of how it should look? I've added a screenshot of what I started trying to build below.

 

Appreciate your feedback into this.

Badge +9

Hi Xenolcon,

 

To set the query params in the Query List action you want to change the Filter configuration:

 

Since this is something that comes up time to time, I created a little workflow that may get you close to what you are after.

 

It checks the Documents library for items that were created in the last 7 days, and processes each one. It shows how to use the query list to get the data you want, and then work with the data, and update the original item too. This is better than iterating or starting multiple workflows generally, as we will only have one instance and the query is quite efficient, where as looping on all items to find certain ones is not good on large lists.

 

To schedule this one, you would want to go to the Workflow Gallery, click the meatball menu and select Schedule. Schedules are only available for Site Workflows

 

Unfortunately I am having issues uploading the NWP right now, I'll try and get it sorted ASAP.

 

Let me know if this helps.

Badge +4

 

Hey Callum,

apologies for the delay in responding, something popped up as an urgent priority at work.

 

Thank you for supplying the NWP file and I loaded the template into the Site Workflow. The flow has really helped me get a better understanding on what is required.

 

I am getting an error though in the part of the workflow I've highlighted below.

I am getting the error message that the string is not recognized as a valid dateTime.

The field I am comparing to is a legitimate date field as displayed below.

The settings I changed from your workflow is the yellow section where it breaks from the image above. I suspect it may be something I've configured the settings that is causing this issue.

Your feedback will be truly appreciated or if you need more details let me know.

Badge +4

Additionally I added the messaging log before hitting the Find Items to Update and below is value and the error.

Badge +4

Hey Callum,

I decided to tackle your solution again and it seemed to work perfectly now!

 

I am not sure if I set one of the variables incorrect in someway but worked a charm now.

 

I am curious, with the setting the date value, what is the reasoning to put this in a loop? Could the same result be achieved without setting it through a loop?

 

I've highlighted in red the area I am questioning. 

 

Again thank you so much Callum for the solution you provided as this will be used over and over again.

 

I've also attached your solution for fellow Nintex users in case they need the same help.

 

 

 

 

 

Reply