Convert list values into one variable - Forum

Forum Navigation
You need to log in to create posts and topics.

Convert list values into one variable

Hi..

I have in a database field multiple values separated by coma like this: apple,orange,tomato,lemon and so on. Every record on database can have different quantity and values.

Now, i want to convert the list values into one variable with <br> so i can presented on screen like this:

apple

orange

tomato

lemon

Any ideas ?

@smartmedia do you mean replacing commas with <br>?

SetVar [value] "apple,orange,tomato,lemon"
StrReplace "[value]" "," "<br>" [value] ""

Just be sure to set the Container (where you want to show the values) ng-bind-html property to [value].

javadrajabihakami and smartmedia have reacted to this post.
javadrajabihakamismartmedia

Hi @luishp

The solution only works on container with ng-bind-html. If i want to have it in a Headline or Paragraphy even with ng-bind-html  is not working.

@smartmedia a Container is a very flexible object.
Use this to use it as a Headline:

SetVar [value] "apple,orange,tomato,lemon"
StrReplace "[value]" "," "<br>" [value] ""
SetVar [value] "<h1>apple,orange,tomato,lemon</h1>"

This as a paragraph:

SetVar [value] "apple,orange,tomato,lemon"
StrReplace "[value]" "," "<br>" [value] ""
SetVar [value] "<p>apple,orange,tomato,lemon</p>"

Anyway I will check the ng-bind-html property for those objects.
Thank you!

smartmedia has reacted to this post.
smartmedia