Convert text into array

I’m using a parser to extract numbers from a google form response (RM4,000 to RM6,000).

I’m looking to split text ( Output text from the Text Parser: `“4,000|6,000|”) into 2 arrays 4,000 and 6,000.

I’m using these formulas:

Min budge: {{replace(split([19.Text]; “|”)[0]; “,”; “”)}} (to get the 4,000)

Max budget: {{replace(split([19.Text]; “|”)[1]; “,”; “”)}} (to get the 6,000)

but all I’m getting back as output is:

[
{
“Min Budget”: “4,000|6,000|[0]”,
“Max Budget”: “4,000|6,000|[1]”
}
]

Does anybody have any idea why? Thank you

Hi Andrea, except I’m getting your explanation wrong, this should be fairly easy, I believe this is what you’re looking to achieve

Hi Emmanuel, thank you for your suggestion, I really appreciate it. I need the two numbers to split into 2 variables, Min Budget and Max Budget, so I believe this formulas should work:

Min Budget - replace(split(19.Text; “|”)[0]; “,”; “”)

Max Budget - replace(split(19.Text; “|”)[1]; “,”; “”)

so I’m expecting this output:

{
“Min Budget”: “6000”
“Max Budget”: “8000”
}

Instead I’m getting this:

Hey Andrea,

Looks like its pretty basic. However, I imagine we will need the input in order to be able to assist you!

Pat
PG Automations

HI Pat thanks for reaching out.

I know I’m going to kick myself once it’s fixed… lol

The input that is coming from the google form is a pre-set option (RM4,000 to RM6,000) which is coming out from the text parser as 4000|6000.

if what is coming out of the text parser is 4000|6000, then use a combination of split and get
if for example this is the result from the text_parser

then use this to extract min and max budgets

RESULT:

Hi Emmanuel, that’s exactly what I needed to do. Thank you for the help!

1 Like