Split and Parser results

Hey,

I’m new here and I need some help. I have a string separated by | and I would like to get each result and add it to another module. I’ve seen some answers here but they didn’t help me.

Eg; hello | world

Return: hello or only world as variable

Welcome to the Make community!

You can use the built-in function split

e.g.:

split(1.text; "|")

For more information, see the function documentation in the Help Center.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

1 Like

Got it, but how get a first and last variable?

{{split(8.text; “|”)}}

result: hello, world

Well, the first and last functions of course! :laughing:

How i do this process, pls

output bundle:

[
{
“value”: “hello”,
“index”: 0
},
{
“value”: “world”,
“index”: 6
}
]

There are multiple ways depending on what you want to achieve.
first() will return the first element of the array.
get() can be used to get specific items using their array index number.

@Stoyan_Vatov Pls, could you give me a practical example? hello | world

What do you mean practical example?

You can find the documentation on various array functions and how to use them here.

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

Getting Started

Help Centre Basics

Articles & Videos

@Stoyan_Vatov Thank you

got it very good for help :laughing:

For those who entered this thread and didn’t find what they needed, I’ll detail it below: What some communities lack is a little effort and patience to explain, because the name already says it: COMMUNITY. If you’re going to read documentation, it doesn’t make sense sometimes for such a simple question, but anyway, few have the virtue of teaching.

Here we go: I needed to extract a text separated by pipes and then create variables for the next module. Ex: hello | world | make

I created the module and used the native split() parameter and it looked like this: {{split(1.text; “|”)}} where [1.text] is the text [hello | world | make]

In the next module i used again just as a test to make sure that I would separate each module and it ended up like this:

{{8.var[1]}} for hello
{{8.var[2]}} for world
{{8.var[3]}} for make

*var was the name of the variables that I defined in the Set Variable module

So you can use any module you prefer in the following.

I used chatGPT (for Make) for learning, which is more willing than any smart human: ChatGPT - Make.com

3 Likes