Skip to main content
Nintex Community Menu Bar

Converting a string to date variable in NWC workflow

  • March 1, 2022
  • 19 replies
  • 740 views

Gavin-Adams
Forum|alt.badge.img+13

I have a component workflow that is receiving dates as a string variable.

The dates are supplied from another web service that is only exporting text strings.

The dates are formatted 'yyyy-mm-dd'

I want to convert this to a date variable in NWC.

I have a variable txtFromDate (text) and dateFromDate (datetime).

I tried set a variable action but the variable types are not supported.

 

Any ideas on this?

19 replies

Sven
Forum|alt.badge.img+7
  • Novice
  • March 1, 2022

Hello @Gavin-Adams , 

 

at the moment, this is not possible in standard -

Please have a look at our roadmap, we will implement this feature this quarter.

 

https://community.nintex.com/t5/Roadmap/Nintex-Product-Roadmaps/ba-p/94755

 


WouterT
Forum|alt.badge.img+9
  • Apprentice
  • May 27, 2022
Any update on this? As per today (27-May-2022) I cannot seem to find anything that supports this nor see it anywhere anymore in the roadmap.

Forum|alt.badge.img+3

I'm needing to do the same.  Any update on the implementation of this?

 

 


Sven
Forum|alt.badge.img+7
  • Novice
  • June 10, 2022

Hi everyone,

 

thanks for the patience, we will check with the product managers and get back to you soon.

 

regards

 

Sven


WouterT
Forum|alt.badge.img+9
  • Apprentice
  • June 10, 2022

OK @Gavin-Adams and @anissa_divincen .

Here is the most ugly workaround you've probably ever seen. More just for the fun of it. I just couldn't cope with 'no' for an answer 😉

A component workflow that transfers any format of a date into a date var. Hope it works for you.

Here is an export key for the component workflow (valid until June 13): QWjRqAHSScRdnLhWZcVd4GLgWzERnDM5JuWpy51ghvzi5LmfG

If you need another export key, drop a reply and I'll provide it.

 

The format input par is by default (if empty) yyyymmdd

But you might also specify anything else that has yyyy, mm and dd strings in it. Such as dd-mm-yyyy or mm/dd/yyyy.

 

No warranty on this little exercise. Check the workflow yourself before using it for real. I actually do not recommend using it, Nintex should come with a real solution.

But really... it is 2022 and we're talking 'global leaders' in software... That we still have to do this - even for the fun of it - is a bit of a shame, isn't it? 


Forum|alt.badge.img+3

Thank you so much, that workflow is exactly what I needed.  At least until they build this into NWC.  Amazed they haven't already. It works perfectly!


  • June 13, 2022

Hi,

the export key doen't work any more. Could you please send a new one, because i have to solve the same problem.

Thanks.


WouterT
Forum|alt.badge.img+9
  • Apprentice
  • June 13, 2022

Hi @EhlertS ,

Here is a new export key: QWuqEh5xFKWxmRhVSuFTNPGdEQNFmRQoGAy9ugfkrUhCcUZEz


  • June 13, 2022
It's a roundabout way - but it works - many thanks 🙂

alexviera
Forum|alt.badge.img+4
  • Rookie
  • June 24, 2022

Hi, 

 

Can you publish a new export key? Thank you.


alexviera
Forum|alt.badge.img+4
  • Rookie
  • June 24, 2022

The NWC toolkit has an action (Convert String to Proper) 

that will do this conversion.

 

https://community.nintex.com/t5/Blog/NWC-Toolkit/ba-p/213241


WouterT
Forum|alt.badge.img+9
  • Apprentice
  • June 24, 2022

@alexviera that is good to hear. I'll try the toolkit.

Just in case,  here is the export key: Qsgj5mxy3P9fjXQUiPpcFsNhM25U3gF4nDu3ezuMSANQcZBb8


alexviera
Forum|alt.badge.img+4
  • Rookie
  • June 28, 2022

Sorry, it was expired 😉 One more time please.


WouterT
Forum|alt.badge.img+9
  • Apprentice
  • June 28, 2022
jtjcojq3X7U2d872ot7Upn4MSciDuvHR3x1muXWpZyjgrzxbk at your service.

WouterT
Forum|alt.badge.img+9
  • Apprentice
  • July 11, 2022

As @alexviera already noted: please use the NWC Toolkit instead. Easier, better, quicker.

Link to the NWC Toolkit page.


WouterT
Forum|alt.badge.img+9
  • Apprentice
  • July 13, 2022

Just tested the NWC Toolkit: all works fine... except... for the date formatter.! Also the NWC Toolkit DateFormatter is an action to convert a date into a string but not the other way around: a string into a date. And that's what we're looking for.

So, I guess you're all back to my (clumsy but workable) solution for now. See also comments on : https://community.nintex.com/t5/Blog/NWC-Toolkit/ba-p/213241

I'll post an update soon with a more simple DIY step by step.

 


WouterT
Forum|alt.badge.img+9
  • Apprentice
  • July 13, 2022

Here is a special post on how to DIY convert a date in text to a date variable.


alexviera
Forum|alt.badge.img+4
  • Rookie
  • July 26, 2022

Ok, maybe I'm missing something. If you take a string date "7/10/2022" and want to convert it to a datetime you call Convert String to Proper, isn't that what you are trying to do?

 

 


WouterT
Forum|alt.badge.img+9
  • Apprentice
  • July 27, 2022

Well done @alexviera ! Kudo well deserved.

The documentation of the toolkit is so brief that I overlooked it. Probably also not realizing the proper meaning of  the word "to Proper". 😉

Took me a while to figure out that the result variable has to be defined as a date variable within the NWC Toolkit section (and not as a workflow variable):

Secondly, the input string has to be in the right format: in my case mm/dd/yyyy. Probably my regional settings. Otherwise it results in this error:

But if that is not an issue: Yep, it works.