Skip to main content
March 24, 2023
Question

Function similar to a!joinarray in 22.4

  • March 24, 2023
  • 12 replies
  • 0 views

Hello:

I am looking to convert an array of number to a single string with comma as the separator.  In 23.1, they have a function called a!joinarray which seems to be the function I want to use but I am on 22.4 CE.  So, the question is there a similar function that will enable me to accomplish this?  

Thank you.

Final desired result: 360392, 361150, 361177, 377913, 378165 

12 replies

man0001Author
March 24, 2023

Found the answer -   substitute(tostring(local!fdcIDSublist),";",",") does what I want

mikes0011
Brainy
March 24, 2023

There is no "a!joinArray".  There is regular "joinArray()" which has been around for many years now (long before any of the "22.x" versions).  What's wrong with just using this, regular, joinArray()?

e.g.: joinArray(local!myList, ", ")

The Expression Guru
davel001150
March 24, 2023

Good to know the substitute approach, but yes I use joinArray() almost every day to do what you said, and I have for many years.

mikes0011
Brainy
March 24, 2023

Yeah, the substitute approach seen here works, but also only kinda by accident - because by casting the array as a string using tostring(), you get Appian's plaintext rendering of the array with the "; " separators, then stripping those out using substitute.  But that totally depends on the behavior of casting an array to a string, which I don't believe there's any particular guarantee will always behave the same way - so of course the cleaner way is handling the array itself, and not taking the extra intermediary steps.

The Expression Guru