Does not react to Popup States inside Reusables

After a popup closes, I would like an action on the main page to react upon a State Change (in this case confirming that a thing was saved to the database through the use of a “Snackbar”)

The Workflow looks like this:

Popup:
User clicks save Button
Set State “Snackbar” to “Show”
Hide Popup

Page:
Do When Popup: Add Thing’s Snackbar is “Show”
Animate Snackbar

But the latter action is never triggered. I have also tried to trigger it by using the “When Popup is closed” instead, but it is also never triggered. Thirdly, I’ve tried to cut “Hide Popup” from the workflow, in case the popup needed to be kept open to be able to reach its state, but it makes no difference.

Is it not possible to react to states in Popups? Any why wouldn’t it react upon the popup close? Any ideas?

Hi @petter :slight_smile: I’m not sure if this is the case, but the animate snackbar action might be running before the popup is closed (and ends before the popup is hidden). Maybe try adding a 1 or 2 second delay in the workflow? Happy to take a look at your app if you can share a link.

1 Like

Hi @fayewatson! Thanks for the input. The workflow is not run at all, as I’ve tried setting a debugging breakpoint in it.

I’m fairly certain I know why it happens now, but I haven’t had time to test it yet. The popup is shown by a reusable – in other words, it doesn’t “belong” to the page where the Workflow is located. The popup is used several places in the app, which means it is present under the elements belonging to the page, so I can access it in the workflow. But it’s not the “same one”. If that makes sense.

I’ll be testing it and updating here if it’s correct. If so, I will probably have to add a state in the reusable that reacts to the popup, and refer to that from the page.

2 Likes

That was indeed it. The state had to go through the Reusable to be recognized, and then it worked.

Hope that finding can help someone else out :slight_smile:

1 Like

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