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

The fn-FormatDate does not work within email notification.

Jump to solution

Inside the email notification body, I entered fn-FormatDate({datevariable},D).  {datevariable} is "4/6/2015".  When I receive the email, I have fn-FormatDate(4/6/2015 12:00AM, D) in the email body.  I am expecting only the Date part not the seconds.  Why the format does not work inside email notification?  How can I make it work?

Labels: (2)
Reply
11 Replies
Automation Master
Automation Master

Re: The fn-FormatDate does not work within email notification.

Jump to solution

Hi Emily,

 

Can you try using a build string action to format your date with the format date function, and then reference the pre-formatted date variable inside of your Email body instead?

 

This should work as a workaround.

 

Thanks,

 

 

Mike

View solution in original post

Reply
redpanda
Nintex Newbie

Re: The fn-FormatDate does not work within email notification.

Jump to solution

Try adding {TextStart} and {TextEnd} around your variable, like this:

fn-FormatDate({TextStart}{datevariable}{TextEnd},D)

Reply
Not applicable

Re: The fn-FormatDate does not work within email notification.

Jump to solution

Thanks for the quick response.  Mike's method works. 

Reply
cgb
Nintex Newbie

Re: The fn-FormatDate does not work within email notification.

Jump to solution

Mike,

I came across this very issue today and thought I would give you my update.  When I have the Send notification action set to "Rich Text" - the fn-FormatDate function does not work.  So I use the Set variable action to format a variable and then reference the variable in my notification.  However, when the Send notification action is set to "Plain Text" the fn-FormatDate function works as expected.  I don't know if this is a bug or a feature - that's how it worked for me.

Thanks for your comment for the workaround.

Chris

Reply
lonesurvivor
Nintex Newbie

Re: The fn-FormatDate does not work within email notification.

Jump to solution

For me in Nintex Workflows 2013 3.1.7.10 International this works but there has to be a workaround as there is a still unfixed bug with user's display-language (if you change for e.g. from en-us to de-de, days and months from input-field gets switched which crashes the inline-function as for e.g. 13.02.2016 is not a valid date).

See this post:

UK date format displayed in SharePoint, interpreted as US date format in Nintex

This way works for me:

Results to:

Reply
carlosn
Nintex Newbie

Re: The fn-FormatDate does not work within email notification.

Jump to solution

I'm a Nintex noob and recently ran into this problem.  I did some debugging and found out the following which I'm adding for anyone who may stumble upon this thread 

The fn-FormatDate function definitely seems to not work when used inside an RTF notification, but seems to work in a plain text notification.  More interestingly, if you convert a plain text notification to a RTF notification, any fn-FormatDate calls DO work.

I went digging into the HTML code of the RTF notification and found out that when you "Insert Reference" to a workflow variable while in RTF mode, the editor wraps the reference in a <span> tag.  This appears to break the function call.

Options to fix this (in order of preference):

  • Create the entire string while still in the "Insert Reference" dialog.  This wraps the function in a <span> but not the underlying variable reference.
  • As Mike suggested, Build a helper string
  • Create all the initial references while in "basic text" mode and then convert to RTF
  • Hack the underlying HTML code

Carlos

Reply
marnita
Nintex Newbie

Re: The fn-FormatDate does not work within email notification.

Jump to solution

I am lost. I have followed this post and others that I have searched and have not been able to get anything to work. I am new at this so I'm certain I'm missing one little step in Mike's (or anyone's explanation.) I am using O365. Is this making the difference? Would someone be kind enough to spell out each step for me? Thank you.

0 Kudos
Reply
citizenpaul
Nintex Newbie

Re: The fn-FormatDate does not work within email notification.

Jump to solution

Your first option worked brilliantly Carlos, both in the Subject and Body of the email.

I'm using Nintex 2010

Thanks

0 Kudos
Reply
rebecca_gordon
Nintex Newbie

Re: The fn-FormatDate does not work within email notification.

Jump to solution

I'm having the same problem in Office 365, it's driving me nuts. I need to append the date/time nicely formatted to the document names to avoid duplicates. I wonder if all of these posts were for on-prem? ‌ anyone we can ask?

Kind regards,

Rebecca

Reply