cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to identify current time when workflow run

I'm using Nintex Workflow 2010 and below what are I have:

I have a choice type variable (varCurHourSlot) and its options are Hour 1, Hour 2, Hour 3.

Another datetime type variable (varCurrentDateTime) and current time, when workflow is executed, is assigned to this varCurTime by using Calculate date action.

My question is how the logic would be to identify current hour is in which hour slot. I have tried using Set variable action with the If conditions below but it does not work.

 

fn-If(fn-And(fn-GreaterThan(7,fn-FormatDate(varCurrentDateTime,%h)),fn-LessThanOrEqual(16,fn-FormatDate(varCurrentDateTime,%h))),1,fn-If(fn-And(fn-GreaterThan(16,fn-FormatDate(varCurrentDateTime,%h)),fn-LessThanOrEqual(24,fn-FormatDate(varCurrentDateTime,%h))),2,3))

Please help! Thanks.

Labels: (2)
0 Kudos
Reply
3 Replies
Automation Master
Automation Master

Re: How to identify current time when workflow run

Hi Kiet Vo

I do not see If, And functions in the workflow when you are settings a workflow variable. How are you creating this function?

This calculation looks more like a label on the Nintex form. 

In the workflow you can use build string action to get the hour part. fn-FormatDate({ItemProperty:EffectiveDate},hh)

And the using If action, check the value of this variable.

Reply
Not applicable

Re: How to identify current time when workflow run

Thanks Kapil Joshi‌, I will try that Build String action. How do you compare string with integer?

Reply
Automation Master
Automation Master

Re: How to identify current time when workflow run

Use Convert Value action to convert String to number and store it in the number type variable.

Reply