How to Split ChatGPT Output into 30 Separate Lines in Make?

Hi everyone,
I’m working on a Make scenario that uses the OpenAI ChatGPT module to generate 30 LinkedIn post hooks (one per line). The model returns the hooks as plain text, each on a new line (no numbering or formatting), like this:
Hook 1
Hook 2
Hook 3

Hook 30

I need to split this output so that each individual hook can be processed separately in the next module (e.g., Airtable Create a Record — one row per hook).

What’s the best way to split this text into an array of 30 items, one per line, so I can iterate over them? I’ve tried using the Iterator module with a split function, but I’m not sure how to format it correctly.

Any help or example setups would be really appreciated!

Thanks in advance :raising_hands:

PS: here is the formula I used: split(trim({{5.choices.message.content}}); “\n”)

Hey Patrick,

you need to have a repeating unique identifier at the beginning or end of each item to use the split() function. Let’s say you have the Hook word only in those places. Then it would be

{{split("input"; "Hook")}}

Maybe you can tell ChatGPT to separate them with something unique that is not present in the text it self.

Thx Stoyan!
I will try and let you know if it works!

Welcome to the Make Community!

If your delimiter is a newline then you can just use the special variable newline.

{{ split(1.result; newline) }}

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

@samliew

Thx!
It didn’t work, but I’ll find out using a parse Json.
Thanks again!

You have not yet provided sufficient information to demonstrate the problem that would allow us to reproduce the scenario and any error(s).

If you need further assistance, please provide the following:

1. Relevant Screenshots

Could you please share screenshots of your full scenario? Also include screenshots of any error messages, module settings (fields), relevant filter settings (conditions), and module output bundles. We need to see what you’re working with to give you the best advice.

You can upload images here using the Upload icon in the text editor:

We would appreciate it if you could upload screenshots here instead of linking to them outside of the forum. This allows us to zoom in on the image when clicked, and prevent tracking cookies from third-party websites.

2. Scenario Blueprint

Please export the scenario blueprint. Providing your scenario blueprint file will allow others to quickly recreate and see how you have set up the mappings in each module, and also allows us take screenshots or provide module exports of any solutions we have for you in return - this would greatly benefit you in implementing our suggestions as you can simply paste module exports back into your scenario editor!

To export your scenario blueprint, click the three dots at the bottom of the editor then choose ‘Export Blueprint’.

You can upload the file here by clicking on this button:

3. Output Bundles of Modules

Please provide the output bundles of each of the relevant modules by running the scenario (you can also get this without re-running your scenario from the History tab).

Click on the white speech bubbles on the top-right of each module and select “Download input/output bundles”.

A. Upload as a Text File

Save each bundle contents in a plain text editor (without formatting) as a bundle.txt file.

You can upload the file here by clicking on this button:

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario, especially if there are complex data structures (nested arrays and collections) or if external services are involved, and help you with mapping the raw property names from collections.

Sharing these details will make it easier for others to assist you.