How to split a single long string of text into a list of objects where each item is length of parapgraphs?

Ok, I figured out how to use the WITH_ITEM formula to add new paragraphs to list of paragraphs. Now I need to figure out how to take a long article and separate it so that the entire text is divided into items in the paragraph list. It would be nice to detect new line breaks and separate them accordingly, but if i can first figure out how to separate them I can work that out later. I have a feature which allows users to import docs from other app into a post or a chapter for a book and need to be able to set the paragraphs separated into a repeater list of input since appgyver input has limited number of characters which can be in a single input.

In this case you might be better of with adding a unique character to the end of the paragraph string in order to have a unique character by which you can separate the long string. I mean, you can go with the “.” but that would separate each sentence.

The formula you are looking for is the

SPLIT(texttosplit, "splitpattern")

What I would do is to add “~” to each item in the WITH_ITEM formula.
Then when you need to show the text, just get rid of the last character:

RIGHT_STRIP(text, 1)

Or even you can go with a solution that might seem to be weird. Create a list of paragraphs that have same length.
For this I would use the SUBSTRING formula

1 Like

I discovered that “\n” as the split token works perfectly to separate the paragraphs! But now what I need to do is add the list of paragraphs to the list of objects variable paragraphList with each key a sequential number, and I am having a hard time doing this. I have a list of texts and I want to make the list of texts into an array with each object being the paragraphNumber : paragraphText

Do this:

MAP(listoftext, {paragrahNo: your method of uid generation, text: item})

I think I got it perfect.

1 Like

Explained here:

More on the writer logic here. It started as a question and I just kind of edited to add the solution so others can follow the path to the solution.