Break up text into sections and refer specifically to each section

Hi!
I want to use a single API call to pull in a whole lot of text, which is structured in multiple sections or paragraphs, and each section will have a title.
Then I want to be able to send individual sections and individual section titles to other display fields.

For example:
Display [3rd Section Title] in TextFieldX,
Display [5th Section Body] in TextFieldZ, etc.

Note that this “display it here” instruction will be consistent. In other words, [3rd Section Title] will ALWAYS be displayed in TextFieldX every single time the process is run.

How do I do this?

I have the ability to add tags or other identifiers into the API response (eg by saying “insert [SectionBreak] between each section in the response”) but I’m not sure what to add and how to then refer to a specific section later on.

I thought of using Repeating Groups, but not sure if I can split the Title from the Body and refer to each one and send them separately to other display fields.

Do I need to get the response to include a number for each section, eg [Section1], [Section2]?
Do I save each section to its own field in the DB? If so, how?

Not sure if this will work for you but I extensively do something similar as a way to create indexes. Join a list or nested lists into a string.

:split by has always worked for my apps. You could use a character like | or a set of characters like {}to mark the breakpoints. Use different characters for nested levels.

Thanks. I did know about the Split By function. Im not sure how to use it in a dynamic way so that it can accurately split the text into numbered sections and save them to specific DB fields, when the I don’t know up front how many sections there will be.
But at the moment I am going to use this Split by function and will have to just hard-code how many sections ChatGPT returns.