Skip to main content
Nintex Community Menu Bar

Converting a string to date variable in NWC workflow

  • Mar 1, 2022 12:40 AM UTC
  • 19 replies
  • 855 views
  • Translate All

Gavin-Adams
Nintex Partner
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
  • Mar 1, 2022 11:17 AM UTC

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

 

Translate

WouterT
Forum|alt.badge.img+9
  • Apprentice
  • May 27, 2022 9:17 AM UTC
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.
Translate

Forum|alt.badge.img+3

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

 

 

Translate

Sven
Forum|alt.badge.img+7
  • Novice
  • Jun 10, 2022 7:16 AM UTC

Hi everyone,

 

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

 

regards

 

Sven

Translate

WouterT
Forum|alt.badge.img+9
  • Apprentice
  • Jun 10, 2022 8:36 AM UTC

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? 

Translate

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!

Translate

  • Jun 13, 2022 9:23 AM UTC

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.

Translate

WouterT
Forum|alt.badge.img+9
  • Apprentice
  • Jun 13, 2022 9:37 AM UTC

Hi @EhlertS ,

Here is a new export key: QWuqEh5xFKWxmRhVSuFTNPGdEQNFmRQoGAy9ugfkrUhCcUZEz

Translate

  • Jun 13, 2022 10:31 AM UTC
It's a roundabout way - but it works - many thanks 🙂
Translate

alexviera
Nintex Partner
Forum|alt.badge.img+4
  • Nintex Partner
  • Jun 24, 2022 4:32 PM UTC

Hi, 

 

Can you publish a new export key? Thank you.

Translate

alexviera
Nintex Partner
Forum|alt.badge.img+4
  • Nintex Partner
  • Jun 24, 2022 7:31 PM UTC

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

Translate

WouterT
Forum|alt.badge.img+9
  • Apprentice
  • Jun 24, 2022 7:53 PM UTC

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

Just in case,  here is the export key: Qsgj5mxy3P9fjXQUiPpcFsNhM25U3gF4nDu3ezuMSANQcZBb8

Translate

alexviera
Nintex Partner
Forum|alt.badge.img+4
  • Nintex Partner
  • Jun 28, 2022 6:09 PM UTC

Sorry, it was expired 😉 One more time please.

Translate

WouterT
Forum|alt.badge.img+9
  • Apprentice
  • Jun 28, 2022 6:12 PM UTC
jtjcojq3X7U2d872ot7Upn4MSciDuvHR3x1muXWpZyjgrzxbk at your service.
Translate

WouterT
Forum|alt.badge.img+9
  • Apprentice
  • Jul 11, 2022 4:32 PM UTC

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

Link to the NWC Toolkit page.

Translate

WouterT
Forum|alt.badge.img+9
  • Apprentice
  • Jul 13, 2022 9:31 AM UTC

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.

 

Translate

WouterT
Forum|alt.badge.img+9
  • Apprentice
  • Jul 13, 2022 10:55 AM UTC

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

Translate

alexviera
Nintex Partner
Forum|alt.badge.img+4
  • Nintex Partner
  • Jul 26, 2022 4:41 PM UTC

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?

 

 

Translate

WouterT
Forum|alt.badge.img+9
  • Apprentice
  • Jul 27, 2022 10:37 AM UTC

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.

Translate