Skip to main content
Nintex Community Menu Bar
Solved

How do I call fn-formatDate()?

  • August 28, 2026
  • 7 replies
  • 89 views

Forum|alt.badge.img+6

I’m trying to generate a text variable with a custom date.

I can’t use “Format date from String”: none of the built-in “Format” options match what I need.

I’d prefer NOT to use a form (this will be a component workflow, invoked from an external app), so I’m not sure this documentation applies:
  https://help.nintex.com/en-us/nwc/content/designer/Functions/formatDate.htm

This is EXACTLY what I’m looking for: yyMMddHHss:
  

I’m trying to use fn-FormatDate({Workflow:Current Date and Time},"yyMMddHHmm") in “Set Variable”.

It’s printing out “fn-FormatDate(...)” instead of executing the inline function:

Q: What am I missing???

 

BACKGROUND:
What brought the question up is that I was trying to do several SMALL tasks that I THOUGHT were “trivially simple”: a) format a custom date string (this question), b) generate a random number, c) create a text file formatted with embedded newlines, d) etc. etc.

I found this “workaround” for the custom date string:
1. Call Format Date Time with one of the built-in formats
2. Apply a regex to change it to the format I need
  <= But I’d prefer to call one inline function instead of invoking two separate actions...

But I’d still like to know:
Q1: is there a built-in “fn-FormatDate()” function, and how do I call it in an NWC action?
 

GENERAL QUESTION:
Our solution is deployed as an NAC-G workflow in a secure environment.  For the most part, we CANNOT call any custom web services.

Q2: Is there ANY way to create “custom code” in an NAC-G workflow that DOESN’T rely on an external, 3rd party web service?
  <= Is it possible to write “custom code” -  in any language: C#, Java, PowerShell, JavaScript, Python, etc. etc. - and somehow “embed” it with the workflow?




 

Best answer by Simon Muntz


I found this “workaround” for the custom date string:
1. Call Format Date Time with one of the built-in formats
2. Apply a regex to change it to the format I need
  <= But I’d prefer to call one inline function instead of invoking two separate actions...

But I’d still like to know:
Q1: is there a built-in “fn-FormatDate()” function, and how do I call it in an NWC action?
 

GENERAL QUESTION:
Our solution is deployed as an NAC-G workflow in a secure environment.  For the most part, we CANNOT call any custom web services.

Q2: Is there ANY way to create “custom code” in an NAC-G workflow that DOESN’T rely on an external, 3rd party web service?
  <= Is it possible to write “custom code” -  in any language: C#, Java, PowerShell, JavaScript, Python, etc. etc. - and somehow “embed” it with the workflow?
 

Q1. The functions you are referencing are only for forms. The form functions are not available to be used in a Nintex Workflow. They have to be used in a form first, and the output passed to the workflow.
Nintex Workflow does not have an equivalent to the form functions. Your solution using Regex may have to suffice.

Q2. There is no way to create custom functions embedded into Nintex Workflow.
The two ways to extend the platform are Form Plugins and Workflow Xtensions which I am pretty sure are not available in NWC-G. (Government Edition).

Plugins do allow you to embed JavaScript, but this is in a form and not in the Workflow.
Xtenstions allow you to call your custom code via a web service.
 

7 replies

Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • Answer
  • August 30, 2026


I found this “workaround” for the custom date string:
1. Call Format Date Time with one of the built-in formats
2. Apply a regex to change it to the format I need
  <= But I’d prefer to call one inline function instead of invoking two separate actions...

But I’d still like to know:
Q1: is there a built-in “fn-FormatDate()” function, and how do I call it in an NWC action?
 

GENERAL QUESTION:
Our solution is deployed as an NAC-G workflow in a secure environment.  For the most part, we CANNOT call any custom web services.

Q2: Is there ANY way to create “custom code” in an NAC-G workflow that DOESN’T rely on an external, 3rd party web service?
  <= Is it possible to write “custom code” -  in any language: C#, Java, PowerShell, JavaScript, Python, etc. etc. - and somehow “embed” it with the workflow?
 

Q1. The functions you are referencing are only for forms. The form functions are not available to be used in a Nintex Workflow. They have to be used in a form first, and the output passed to the workflow.
Nintex Workflow does not have an equivalent to the form functions. Your solution using Regex may have to suffice.

Q2. There is no way to create custom functions embedded into Nintex Workflow.
The two ways to extend the platform are Form Plugins and Workflow Xtensions which I am pretty sure are not available in NWC-G. (Government Edition).

Plugins do allow you to embed JavaScript, but this is in a form and not in the Workflow.
Xtenstions allow you to call your custom code via a web service.
 


Chris_Ben
Nintex Employee
Forum|alt.badge.img+14
  • Nintex Employee
  • September 2, 2026

Probably the easiest for you is to create a component workflow to format the dates so you can use it multiple times in your workflow (or by other workflows).  Here’s an example one which is using RegEx to perform all the manipulation.  NB make sure to change your time zone to your correct time zone in the format date to string action.

 

Export key: PCBXz9RoyrDLZTePUqMFam5gxp5tVhmWZEnULRgg31sSK7nNn

 

Just in case you are not allow to/can’t import a workflow to NWC-G here are the instructions to replicate.

 

Create a start variable.  Datetime data type.  I called mine Date to format.  Here’s the workflow outline

Create two workflow variables both are text data types

First one I’ve called “Raw date”.  Second one make sure you have ticked the output box.  I called mine “Formatted date”.

 

Here’s the workflow outline

 

Format date to string:

 

Apply a RegEx

 

The log action just logs the raw and formatted dates.

 

Hope that helps.


Forum|alt.badge.img+6
  • Author
  • Nintex Partner
  • September 2, 2026

Hi, Chris_Ben -

Thank you for the response.  But like I explained above (in the “addendum” to my initial post), I was already familiar with the “2-step regex” workaround, and I’m successfully using it.

It’s just “disappointing” that I NEED this workaround.  The “Format Date Time” action should really support custom formats out of the box :(

Moreover, it’s REALLY disappointing that NAC (and particularly NAC-G) seems to offer ZERO capabilities for implementing ANY custom functionality that doesn’t involve relying on external web services.  Which, for our customer, simply isn’t allowed (for very good reasons).

 


Chris_Ben
Nintex Employee
Forum|alt.badge.img+14
  • Nintex Employee
  • September 2, 2026

Yep.  That’s precisely the point of NAC-G that it is locked down so malicious code cannot be accidentally executed for the protection of all of the Government agencies that require that level of control.

 

One other option for you but it’s a much bigger conversation with the customer is to look at deploying Nintex K2 on-prem.  That option provides both security and complete customisation but as you already have a very feasible solution with either a component workflow (or using the formatdate+regex combo) then there would need to be other reasons to think about moving.


Forum|alt.badge.img+6
  • Author
  • Nintex Partner
  • September 2, 2026

“Custom date” is just one example.  “Generate a random number” is another example (I believe I have a workaround for that, too).

There’s an infinite number of things that any given application might NEED to do that don’t happen to be supported by “out-of-the-box” functionality.  Hence the need for SOME kind of “custom functionality”.

It’s unfortunate that, although NAC forms allow some custom functionality (for example, via in-line functions and JS plugins), NAC workflows only allow Xtensions...which only work with external web services :(

BTW:
I know nothing about “Nintex-K2”.  I’ve focused exclusively on Nintex RPA (for on-prem automation) and “Nintex Automation Cloud” (nee “Nintex Workflow”) for “workflows”.  But who knows: perhaps “Nintex-K2” might solve a lot of the challenges we’ve been facing.

Thank you for the tip :)


Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • September 4, 2026

Hi ​@paulsm4,

As this will be a component workflow, you can pass start variables to it. Is it possible for the system calling the workflow to pass an already formatted date?


Forum|alt.badge.img+6
  • Author
  • Nintex Partner
  • September 10, 2026

Thank you, Simon,  But in this case, the workflow needs to generate the custom-formatted date itself.
the 2-step “Format date from String/use regex” is an acceptable workaround.