Define Variable with current date but fixed time

  • 17 March 2017
  • 5 replies
  • 6 views

Badge

Hi I need to set up a workflow condition that decides which branch of the workflow has to be followed, based on the time that a specific action has been executed.

E.g. my workflow starts when a new item in a SharePoint list has created. I want a condition that sais that if the creation date happens before or equals then 10:00 AM, certain actions will follow, otherwise the workflow will take a different path.

My problem is that I don't manage to set a variable that calculates each time "current date" 10:00 AM


5 replies

Userlevel 5
Badge +14

look at this thread  

it's for forms but you can use the same logic in workflow too

Userlevel 7
Badge +17

Is this workflow really created in nintex workflow cloud‌ or you chosed that space by mistake?

If so then this is not easy. Or at least I can't find a better solution. What you should do then is to use the following set of actions:

200972_pastedImage_1.png

  1. Convert your execution time into a string, formatting it into YYYY MM DD HH:mm:ss
  2. Use regular expression action, and extract the string using the regex:
    [0-9][0-9]:[0-9][0-9]
  3. Split the string using ";" sign into collection.
  4. Get {0} element from collection (your Hour)
  5. Compare it with the "10" to justify whether it was executed before or after 10am

Regards,

Tomasz

Badge +7

I have the same question, but I am not in the cloud. I reviewed the post that Marian Hatala referenced. It seems that if you want to extract only the time, it's going to be tricky no matter what you do.

I am going to post a similar question as well.

Userlevel 7
Badge +17

Can you link it from here?

If you are in O365 solution will be similar as there are also no inline functions.

If you are in on premise then Marian's solution should be exactly what you're looking for.

Badge +7

I decided to build a date string then evaluate that against the Start Date:

[Current Date] 12:00 AM

It works. That was crazy easy. (I'm still learning Nintex...)

Reply