How to split a Field's text then loop through each paragraph using a 'Next' button?

I am looking to present a lesson for students one paragraph at a time like below. The idea is that the student can click ‘Next’ to skip to the next paragraph in the lesson.

Each lesson is stored as a field, but includes ALL paragraphs, as you can see here in the ‘text’ section:

I have tried to separate out each paragraph (e.g. splitting like below) but haven’t been able to loop through all the paragraphs as intended.

Any suggestions would be appreciated.

Create a RG of texts. And as it source, do exactly what you are doing. Split the text by paragraphs.

Set your RG to show only one row per time and create a button to move to the next page of this RG. This will keep changing the sentence to be next paragraph.

You’re a legend @rpetribu.

Thanks for your help - got it working with the addition of a ‘Show next’ inside of Workflow.

The only small thing that isn’t quite right is that the ‘Show next’ also includes the spaces - so it will show: paragraph 1, blank, paragraph 2, blank, etc. Do you have any idea about how to prevent this? I’m guessing there will need to be some kind of a condition.

Cheers

Glat to help! :rofl:

Sorry, I noticed that you already have space between your paragraphs. That is why the code is altering between text and empty values. To fix this is quite simple, just add in the end of the expression at your repeating group source the command “:filtered” and filter by “this text is not empty”.

This should work!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.