Skip to main content
April 9, 2025
Question

List of String to String with line break

  • April 9, 2025
  • 6 replies
  • 0 views

HI ,

I have a requirement where I need to pass Sting values with separate Line to API .

here is the  List of Sting with 4 items.

“28978937982932090”

“28978937982932091”

“28978937982932092”

“28978937982932093”

I want to send it as single string with line break to API 

“28978937982932090

28978937982932090

28978937982932090

28978937982932090”

Can you help me with this scenario.

Thanks in advance

6 replies

April 15, 2025

You may be able to do this using the char() function.  Join the list of strings with char(10) as the separator.

joinarray(local!yourListOfStrings, char(10))

mikes0011
Brainy
April 15, 2025

Why do you need to transmit them "with line break" as opposed to just transmitting a list and letting the remote end deal with the list in whatever way it needs?  The standard for transmitting lists via a simple single string would be JSON, and you can very easily transform a list of string items to JSON in Appian using a!toJson().  JSON is a standardized format so the remote end should be able to unpack the list with arbitrary difficulty and treat it however is needed.

mathieud0001
April 16, 2025

I have the same question. Just use a delimiter.

mikes0011
Brainy
April 16, 2025

A delimiter would work too, though I've done this before and you quickly run into the issue of having to build your own parser and potential corner cases (though for "list of integer as string" the corner cases are admittedly few), while JSON should automatically that, which is why I default to suggesting JSON before other approaches (noting, of course, that neither is "wrong" per se).