55
Views
8
Comments
Solved
Converting a string list to a string
Application Type
Reactive
Service Studio Version
11.55.8 (Build 63965)

Hello all, looking for an absolute OutSystems wizard...

I am trying to import an element of an excel document, which is a simple string but multiple items:

I need to break this string of items into a list, but currently I cant figure out how. i know to import them I can have them on separate lines, but the excel document has thousands of records, so to break this string up would save lots of time


To summarise:

I need this string to become a text list


Any help is welcome!

Thanks in advance,

Max

2019-01-07 16-04-16
Siya
 
MVP
Solution

Please see if String_Split from Text Extension helps. Here you can pass a string , delimiter ( "\n" , "\r\n") and it will return a list.


2024-04-03 15-32-55
Maxwell Mckinnon

Hi Siya, 

I seem to get an error when using those delimiters, it doesnt accept having more than one delimiter but ive tried both and neither seem to split the list unfortunately.

Could i be doing something wrong?

2024-04-03 15-32-55
Maxwell Mckinnon

Nevermind Siya, 

I have got it working, turns out in my case the delimiter just had to be "", and it returns the list as expected

thanks for your help

2019-01-07 16-04-16
Siya
 
MVP

It must be either \n or \r\n, but not both. Apologies for the confusion. If you have a sample Excel file with limited data, please feel free to share it.

2019-01-07 16-04-16
Siya
 
MVP
2026-01-28 16-57-48
Mihai Melencu
Champion

Hello @Maxwell Mckinnon ,


You can use the String_Split server action from the Text extension:


2019-01-07 16-04-16
Siya
 
MVP
Solution

Please see if String_Split from Text Extension helps. Here you can pass a string , delimiter ( "\n" , "\r\n") and it will return a list.


2024-04-03 15-32-55
Maxwell Mckinnon

Hi Siya, 

I seem to get an error when using those delimiters, it doesnt accept having more than one delimiter but ive tried both and neither seem to split the list unfortunately.

Could i be doing something wrong?

2024-04-03 15-32-55
Maxwell Mckinnon

Nevermind Siya, 

I have got it working, turns out in my case the delimiter just had to be "", and it returns the list as expected

thanks for your help

2019-01-07 16-04-16
Siya
 
MVP

It must be either \n or \r\n, but not both. Apologies for the confusion. If you have a sample Excel file with limited data, please feel free to share it.

2019-01-07 16-04-16
Siya
 
MVP
UserImage.jpg
Bhavadharani M

Hi @Maxwell Mckinnon,

You can use String_Split server action. Here you need to pass string and a separator parameters, and it returns a List of strings.

You can find more information in the documentation:
Text API - OutSystems 10 Documentation 

Hope it helps!

Thanks.

2023-11-22 10-51-50
Jozy Sohail

Hi Maxwell,

AS everyone suggested try using String Split action,

you can pass your text as input with delimiter as space " " or new line and it will return you the text list.

hope it helps.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.