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

Date time field in Word document

Jump to solution

I am using the Generate Document action.  I have date/time fields I want to insert, but I only want it to display the Date, not the Time.  In the SharePoint Online list, it is formatted to display Date only.  But in the document generated by Nintex Workflow, it displays the date plus 12:00:00 AM as the time.

Is there any way to display only Date?  When inserting the tags into Word, it only has format options that include both Date & Time.

 

Labels: (2)
Tags (1)
0 Kudos
Reply
6 Replies
Nintex Employee
Nintex Employee

Re: Date time field in Word document

Jump to solution
Hi,
I would put the date through a Build string action and use a FormatDate() inline function to format the date how you want it and then add that output variable to the Word Document as a string.
0 Kudos
Reply
plamping
Nintex Newbie

Re: Date time field in Word document

Jump to solution

Thanks, that sounds like it will work.  I will do that.  First, I have to work on another issue, and that is developing a way to speed up the process so our employees are not waiting several minutes for while the document is being generated in order for them to sign it.

 

One step at a time.

0 Kudos
Reply
plamping
Nintex Newbie

Re: Date time field in Word document

Jump to solution

I used Build String but it does interpret the function properly.

 

It appears like this when I send an email to myself to test:

 

fn-FormatDate(8/13/2019 12:00:00 AM , "MM/dd/yyyy")

 

Is it fn-FormatDate or FormatDate ?  The Nintex documentation suggests fn-FormatDate.

0 Kudos
Reply
Nintex Employee
Nintex Employee

Re: Date time field in Word document

Jump to solution

Hi,

 

Sorry my mistake.  I forgot this is O365 and there are no inline functions in the build string action.

Instead use a Regular Expression action to replace the time with blank.

Expression to use:

[^\d*\/\d{2}\/\d{4}].*

Action configuration for your test:

RegexDateformat.png

Reply
plamping
Nintex Newbie

Re: Date time field in Word document

Jump to solution
Got it. It worked! One less problem to deal with.
0 Kudos
Reply
plamping
Nintex Newbie

Re: Date time field in Word document

Jump to solution
Another thing I noticed that might be helpful to others -- when I created the variables in the workflow and used those variables in the Word doc (rather than calling the values from the list), it reduced the time it took to generate the document, by 30 seconds to 1 minute. From now on I will always populate my variables first in the workflow and then reference them in the Word doc.
0 Kudos
Reply