Is there a way to create a workflow on the main page when reusable element is triggered?

Hi! I am making a reusable element (an icon and a repeating group) and incorporating it on the index page. I would like to make, that when reusable element’s RG is clicked it would scroll to certain position on different RG which is on index page. Is there a way to do so? Thank you.

You can set a custom state within the reusable element on click of the repeating group row.
Edit: to clarify, the custom state needs to be on the parent reusable element, not the repeating group. This way it can be seen from inside the element and from outside the element ( wherever the reusable element is used)

Then create an event on your index page that triggers every time the custom state is not empty.

Then you can have an action within that event to scroll to your second repeating group, and a second action that resets the custom state to empty ( so it can trigger again on the next click)

5 Likes

Got it!:+1: Thank you, @mebeingken!

Hi again, @mebeingken ! Now I have slightly different case where reusable element is in the repeating group on the index page. When I try to add an event “Do when condition is true” and to set the condition for it the reusable element (and so the custom states within it) is not visible. Any possible ideas to make this work? Thanks!

Hey @d.norkus

My hunch is that the answer lies within understanding more about your use case, but here are some generals thoughts:

A repeating group is similar to a reusable element in that the elements within can only be seen by the repeating group. That being said, you also have the database at your disposal which reaches across the entire app.

So while you could do a series of hand-offs using custom states to pass things up the food chain, you might look to creating something in the database that gets picked up by the index page.

For example, I have an alert element up in the header that provides feedback to users. It generally uses custom states that move from reusable element down to the main page and up to the header. However when it gets more complicated than that (much like you describe) I create a thing in an alert data type and have an event in the header based on a search for those alerts. The custom states feel a bit quicker, but the db is great for avoiding too much complexity.

I also do this when I need to validate the contents of a repeating group. You just save everything in the rg to the database and then reference the list of the rg from the outside.

I imagine there are also JavaScript solutions, but that’s just not my forte.

2 Likes