How do I get a field of 5 lines in one variable into 5 separate variables

:bullseye: What is your goal?

Break a text block into 5 chunks.

:thinking: What is the problem?

I must be insane. I’ve gone through so many tutorials and I just can’t seem to find out the right way to do this simple thing. I have a field with 5 lines of text produced by an app. How do I get those 5 lines to become 1 line in 5 variables so they can be sent to the right field.

:test_tube: What have you tried so far?

I’ve tried different arrays and even JSON but that’s a little outside my mental effort now.

:camera_with_flash: Screenshots: scenario setup, module configuration, errors


1 Like

Hi @nvs ,

To split a field that contains 5 lines in a single variable into 5 separate variables, you can use the split() function along with get() in Make.com. This approach allows you to break the text by each new line and assign each line to a different variable.

You can use the following format for each variable:

{{get(split(35.test_data; newline); 1)}}

Update the index value (1, 2, 3, etc.) to retrieve each individual line.

We’ve attached a screenshot for your reference to help you visualize the setup and mapping.



Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation

4 Likes

You’re very close. You don’t need JSON for this.

If your input is a single text field with line breaks, the cleanest way is to split by line break first, then map each item.

The usual flow is to use Text → Split (delimiter = line break \n), this gives you an array, then map index 1–5 of that array into food1, food2, food3, etc. using Set multiple variables

Right now you’re setting variables before splitting the text, which is why it feels stuck.

If you can share a screenshot of the module that outputs the original text field, it’ll be easy to point to the exact mapping.

1 Like

This was it! Thank you so much, I danced around the solution so many times.

2 Likes

Hi @nvs ,

I’m glad to hear that this solved the issue - sometimes the solution is right there, just needs a small nudge.

Thanks a lot for marking the answer as the solution, really appreciate it.
If you run into anything else or need further help with Make.com, feel free to reach out anytime.

Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation