Solved

Date time field in Word document

  • 12 August 2019
  • 6 replies
  • 72 views

Badge +8

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.

 

icon

Best answer by SimonMuntz 14 August 2019, 02:49

View original

6 replies

Userlevel 6
Badge +22
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.
Badge +8

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.

Badge +8

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.

Userlevel 6
Badge +22

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:


Badge +8
Got it. It worked! One less problem to deal with.
Badge +8
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.

Reply