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

Updating a date/time variable in a workflow?

Jump to solution


I have a calendar that tracks time off for employees.  They select a start date/time and end date/time and also have the option of choosing all day.  Once enter it goes to a request table.  In the request table approvers can either approve or reject the requests.  In the request workflow I need it to update the date/time fields if All Day is true.  I know who to check the condition, my problem is with updating the date/time.  I need to set the start date/time to the day they originally selected and the time to 12:00AM.  I also need to set the end date/time to the end date they selected and the time to 11:59PM.  I cannot figure out how to do this in the workflow.  When I select Update Item in the workflow and then select the field to update the only option I have is to use the calendar.  How do I do something so simple?  Am I missing something?

Thanks

Labels: (1)
0 Kudos
Reply
9 Replies
mapeacock
Nintex Newbie

Re: Updating a date/time variable in a workflow?

Jump to solution

Hi,

If you add a calculate date control to the workflow, you should be able to feed in the date and tweak it appropriately. Store the output into a datetime variable and then use an update item control to set the field to the variable:

Cheers,

Mark

Reply
Not applicable

Re: Updating a date/time variable in a workflow?

Jump to solution

Thanks for the quick response.  I'm still having some trouble figuring out how to change the date to the value I need.  I can add/subtract a specific amount of time but the time I need to add/subtract varies depending on what is currently in the field.  For example if the user selects a start time of 10am, I will need to subtract 10hrs.  If the user selects 1pm as a start time, I would need to subtract 13hrs.  How would I do this?  Can I access the selected date/time's current time in the textbox that is used to add/subtract hours?
Thanks

0 Kudos
Reply
mapeacock
Nintex Newbie

Re: Updating a date/time variable in a workflow?

Jump to solution

Hi,

If you ensure that the highlighted checkbox in my screenshot is not checked, and you set the time to 12AM, you should be able to add your 11 hours and 59 minutes for your end time and leave it as is for your start time.

I hope that helps!

Mark

0 Kudos
Reply
Not applicable

Re: Updating a date/time variable in a workflow?

Jump to solution

I don't have that option available because I am reading in the value from a list item.  The user submits a leave request and it gets stored in "request" list.  Their supervisor is notified and then the supervisor logs in and either approves or denies the request which moves the request to either the "approved" or "denied" list.  Since I need to keep the date value, I cannot select "value" from the dropdown, I have to select "List Lookup."  Is there any way to solve this?  I really don't see why I cannot just set the time to a specific value instead of only being able to add and subtract values from it.

0 Kudos
Reply
mapeacock
Nintex Newbie

Re: Updating a date/time variable in a workflow?

Jump to solution

Hi,

I agree - the treatment of dates appear to be somewhat less flexible than most other data types. I wonder if there would be any benefit in using the Convert value control which will allow you to run some of the inline functions against the datetime value on the way in. These functions include DateDiff functions and a format date function which may allow you to effectively "zero" out the time factor .

So users can nominate a start time for leave - not just a date? It would be easier to work with just a start and end date-only field. Potentially you could utilise separate fields for the entry of date and time and this would allow you to have that separation and treat the dates as you would like.

Cheers,

Mark

0 Kudos
Reply
mapeacock
Nintex Newbie

Re: Updating a date/time variable in a workflow?

Jump to solution

Just confirming - this appears to do what you want:

Obviously you would put in your start date/time list value in where I have used "Created". This generates an output of "18/02/2015 12:00 AM" for today. You can then add your 11 hours and 59 mins in a subsequent Calculate Date control.

Cheers,

Mark

Reply
Not applicable

Re: Updating a date/time variable in a workflow?

Jump to solution

Thank you

0 Kudos
Reply
jonathankite
Nintex Newbie

Re: Updating a date/time variable in a workflow?

Jump to solution

What is this screenshot from?  I cannot find a conversion or configure action control in Nintex Workflow?

0 Kudos
Reply
Not applicable

Re: Updating a date/time variable in a workflow?

Jump to solution

Hi Jonathan, the screenshot is from the Convert Value action.

0 Kudos
Reply