Toggle popup for a specific user as part of workflow

Hello,

I’m working on a game project with Bubble, and as part of a workflow of a specific action in the game, there is a user initiating the workflow and there’s a target user of that workflow.

Now I would like this target user to see a popup with a notification as part of this workflow.

I am not sure of all the options available.

  1. The one I’m thinking of going with is using a transcript (i.e. a log of events in the game, and that data is already here as a notification of game events to all players). I haven’t looked into it, but hope that I can have a data triggered event where on a new transcript entry is created, a popup would also be toggled, if the target (recorded in the transcript data) is the user.

  2. I was looking at back-end API workflows, but I cannot seem to be able to toggle a page element from there.

  3. Perhaps using custom events but I’m not sure whether they work locally or globally.

How would you go about doing this? Any good tip?

If you want to know more about the game, it’s a web-version rendering of a diplomatic strategy and negotiation card game, called Makiavelia, of which I’m the author.

Hey Benjamin,

I think the first option you described could work. Another idea that comes to mind is setting a yes/no field for the user (let’s call it “notification” for this example). When User A initiates the workflow and specifies the target user, you could have an action that changes the target user’s “Notification” to “yes”. Then, you could have a condition on a page that is “when current user’s notification is ‘yes’ --> show popup” .
Alternatively, you could have a custom data type called “Transcript” with a field called “notification” that is a list of those target users. Then, if the current user is contained within that list, you could show a popup with the information you want to show.

Thanks Jacob. So for the change in data field, how would you trigger? Do I use a “do every second” trigger? or “whenever condition is true”? I guess that ought to work.

I’m thinking that using the field in transcript data could also ensure no other actions are taken until the current action is fully resolved–as when a response from the target user is needed from that popup.

Do when condition is true would be the one you’d want. And yes, if you wanted to force some sort of response from the target user, you could definitely do that too.

1 Like

Okay it’s working but I definitely need to mark the transcript as “read” or else the user gets bombarded with popups on page refresh!

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