cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
mariamerenda
Nintex Newbie

Define Variable with current date but fixed time

Jump to solution

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

Tags (1)
0 Kudos
Reply
5 Replies
emha
Nintex Newbie

Re: Define Variable with current date but fixed time

Jump to solution

look at this thread  

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

0 Kudos
Reply
TomaszPoszytek
Nintex Newbie

Re: Define Variable with current date but fixed time

Jump to solution

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:

  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

Reply
andreapasutti
Nintex Newbie

Re: Define Variable with current date but fixed time

Jump to solution

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.

0 Kudos
Reply
TomaszPoszytek
Nintex Newbie

Re: Define Variable with current date but fixed time

Jump to solution

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.

Reply
andreapasutti
Nintex Newbie

Re: Define Variable with current date but fixed time

Jump to solution

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