Skip to main content
Nintex Community Menu Bar
Question

how can I deserialize an array of strings

  • November 6, 2023
  • 4 replies
  • 338 views
  • Translate All

Forum|alt.badge.img+2

I need to de-serialize an array that looks like this [“1”,”2”,”3”]

and use it in a loop 

how can I turn my string array into a k2 useable reference or variable

4 replies

Deon
Forum|alt.badge.img+10
  • Rookie
  • November 7, 2023

Hi, 

 

you can use the Split, inline function.

 

 

Translate

Forum|alt.badge.img+2
  • Author
  • Rookie
  • November 7, 2023

@Deon this is nice, however It will split like this:
 


I was actually wondering if there was a way to deserialize these values into some kind of enumerable on k2s side

since we are passing this array in as a datafield for this workflow
 


 

 

Translate

Deon
Forum|alt.badge.img+10
  • Rookie
  • November 7, 2023

Unfortunately, the workflow variables are simple types (string, bool, number) etc. so it cannot be arrays or complex objects. Any chance you can just pass in “1,2,3” as the start value?

Translate

adithepo
Nintex Partner
Forum|alt.badge.img+4
  • Nintex Partner
  • November 10, 2023

Can you try to remove the ‘[‘ and ‘]’ (first and last character) of the array before using split function ?

Translate