Skip to main content
โ† Data, API & Backend
Data, API & Backend Solved May 23, 2022 ยท 2 replies

โšก๏ธ Remote action: is it possible to have two actions on success?

Archived from the Bravo community forum (2021โ€“2026). Some answers may refer to older versions of Bravo.

๐Ÿ‘‹ Hello friends!

I finally developed the multi-user like button with Xano โ€“ hurrah! ๐ŸŽ‰
Now I only have one hanging fruit left, and I wonder if someone has found a creative solution for this.

๐Ÿ‘‰ What's happening:
In "My favorites" page, only the "liked" items appear (as they should). However, when the user "unlikes" an item, the item remains on the screen with the default "like" icon. Ideally, when the user "unlikes" an item, the item should be set to "default" and automatically disappear.

๐Ÿ‘‰ What I tested:
โ€ข In the Remote action โ€“ On success, if the "Set state" is selected with the variable ${state}, the "liked/unliked" state successfully carries over to other pages in the app. However, the item stays on the "My favorite" screen (and that's not a great UX).
โ€ข In the Remote action โ€“ On success, if the "Refresh" option is selected, then the item automatically disappears from the "My favorites" page when the user "unlikes" it, but the state doesn't carry over other pages.

Is it possible to have both actions active on success?
Alternatively, has anyone found another workaround?

Thank you all, and best of luck with your projects!

Remote action.png

2 replies

Javier Felipe Bravo team May 24, 2022

Hi Leonor,

Unfortunately, it's not possible to add two response actions to be executed after a remote action. As a workaround, I'd suggest the following:

  • Use the "Refresh" action instead of "Set State" in the page where only the liked items appear. This will force a new API call, as long as the state is updated in the backend, only the liked items will appear after refreshing.
  • Add the [refresh:always] tag to all the screens where you display stateful components. This will also trigger an API request every time you open a screen, so the state will be synced with the backend.
Leonor May 24, 2022

Gracias, maestro!
It works! I'm not sure why it didn't work before?ย 
Anyway โ€“โ€“ YAY!! ๐ŸŽ‰

Wrote something in this thread and want it removed? Request removal

Still stuck?

Ask the community on Discord

This archive is read-only. New questions, office hours and product updates now happen in the Bravo Discord.

Join the Discord