New topic Closed topic
avatar image
1
convert comma separated string into a collection
By Created , last editted

Hi,

I'm wondering if there is a way to convert a comma separated string into a collection.

The comma separated strings are in a model property of type text.

They contain some numbers like in '1,5,12,8,34'

I want to convert the string into a collection, so I can use it in an action in a loop to perform some checks.

I tried to Liquid parse it in a text expression with split:

##{{ "a~b" | split:"~" }} #=> ["a", "b"]

and use the result as the expression for a collection variable, but that doesn't work.









Hi,

I'm wondering if there is a way to convert a comma separated string into a collection.

The comma separated strings are in a model property of type text.

They contain some numbers like in '1,5,12,8,34'

I want to convert the string into a collection, so I can use it in an action in a loop to perform some checks.

I tried to Liquid parse it in a text expression with split:

##{{ "a~b" | split:"~" }} #=> ["a", "b"]

and use the result as the expression for a collection variable, but that doesn't work.








Answers
Sort by:

This topic is closed.