How to implement non-linear flow in strapi?

System Information
  • Strapi Version: 4

Hey there,

We’re working on adding an installation guide to a mobile app.

One thing we’re trying to figure out is how to create non-linear flow. Basically, we want to ask users a question on page 1, and depending on their answer, send them to either page 2 or 3.

We’re not sure how to do this with Strapi. We’d like to be able to set up this flow in Strapi.

The question is who should know whether page 2 or 3 is the next one? Or in other words: Who is responsible for the business logic? Frontend or backend?

Our goal is to configure the logic in the CMS. In this way, a non-technical person can modify the guide without having to update the front-end

Ok.

Out of the box, Strapi is best suited for straight CRUD functionality. So I guess you’d need some customization on the Strapi side. In your case I’d first come up with the models that are necessary to depict your use case. My guess is you have some questions and answers and thresholds and criteria and whatnot in those models. Then you might get the first ideas how the API for that could look. Something like /api/submit-reply or /api/next-question.

For the Strapi part, my guess is you could maybe either make a clever use of the dynamic zone / repeating components within a content type, or for a nicer UI you might need to create some custom fields to be integrated into the admin panel. This requires you to write react based components and use Strapi’s design system.

I guess you won’t come around creating your own plugin. There is documentation for that here:

1 Like