Scheduling a workflow sending me in circles!

I hope someone can help with this as I am going in circles!

My users can create Events and people join the events by clicking a ‘Going’ button. Once the event date expires I want to automatically ‘Unjoin’ everyone from the expired event using a scheduled workflow.

I have my button for ‘Join’ and event and now want to add an additional step in the workflow to remove ‘Joined’ users once the event date expires.

My situation is confusing because I don’t understand if I am editing a User or an Event. I’ve tried all possible combinations but the scheduled workflow is always showing red ‘error’ text. Please could someone walk me through this?

I have a Datatype called “Events”, with a field called ‘Going’ which is a list of users. To identify expired events I use this logic Date > todays date which works well.

Why do you need to “unjoin” if the event is expired?

Anyway, you should be editing the Event. The workflow step would be something like make changes to an Event, to the field Going with the formula this Event's Going Users :minus Current User.

I think this should do it.

In your workflow for your ‘join’ button - what are the steps of that workflow? It should show in there if it is adding a user to a list in your ‘event’ datatype or adding an event to your ‘user’ datatype - or both!

So the steps for ‘make changes to’ when they join you’ll want to reverse. If you are wanting to remove all the users from an event when it’s expired for instance, you can just use ‘make changes to a list of things’ then in the field where the users are added ‘clear list’. If you have a list of events under a user you’d just want to remove that one event - so ‘make changes to a list of things’, then in the field for events ‘remove’ the event.

Though I think you might want to keep the users attached to events and events attached to the user as historical records. Otherwise how will you know who went to what later on?

You can always filter events by date - i.e conditionals like ‘event > current date’ to display events that aren’t expired where you need.

Thanks guys.

The reason I need to unJoin a user once the event has expired is because events can be relisted by the creator, so we want to ‘clear the slate’ so we can see who will be going to the next meeting.

A history is maintained because I show users their expired events and they can also ‘Follow’ events and remain ‘followers’ even after an event expires. When the creator relists their event, all followers are notified with text saying “an event you follow has been relisted”.

Anyway, after reading your thoughts, I’d like to show you more specifically what is happening when I try and schedule a workflow to ‘unJoin’ users from expired events.

This is the workflow for the ‘Going’ button;

going workflow

I set up a schedule event;

I try and then add that custom event to the Going button but the drop down field ‘custom event’ doesn’t work, it won’t drop down or offer any options.

By the way, the custom event I set up wouldn’t work anyway because no matter what I do, the text becomes red ‘error’ text. If I choose Type: Event, I am warned that “You’re trying to change a list of Events”. If, however, I choose Type: User, I am warned that “You’re trying to change a list of Users”.

I have also thought about adding the scheduled workflow to the button which created a new Event. In other words, when you create an event, the ‘Post event’ button would have something saying "when event expires, clear all users Going to the event’. But I faced the same issues as above.

I have identified the issue to be that a scheduled event won’t allow me to ‘make changes to a thing’, it always forces me to make changes to a list of things. I have tried both custom and general scheduled workflows, and get the same issue.

See image below, if I select ‘make changes to a thing’, the options are to either change a ‘current user’ or ‘Do a search for’.

If I change a ‘current user’, it warns me “You’re trying to change a list of Users”.

If I ‘Do a search for’, I attempt to choose Event but it warns me “You’re trying to change a list of Events”.

Frustrating because I have an unJoin button which users can press and that works fine. The logic for that is;

Current page event
Going remove current user

So, the scheduled trigger just needs to say;
Current page event
Date > current date (event date has expired)
Going remove current user.

Why is it so hard to do this?!

UPDATE:

I create a custom event and add that to the workflow but I am told I don’t have a custom event - despite creating one only moments earlier!?

See custom event below:

and now my workflow won’t let me select that custom event from the dropdown?

Sounds like you need a bit more help than just a forum post - I’d suggest some coaching :slight_smile:

2 Likes

Once the event date expires I want to automatically ‘Unjoin’ everyone from the expired event using a scheduled workflow.

To do this you’ll need to use a backend workflow.

All you need to do is schedule the backend workflow to run on the event expiry date, with actions to remove the Users from that event.

From the rest of your posts in this thread it appears you’re trying to schedule a ‘Custom Event’ instead of using a backend workflow (which won’t work for what you’re trying to achieve)

Custom events are browser actions, so you can’t schedule those to run on a set date or time, only after a set number of seconds, and they run client-side, so once the user closes the browser they won’t run.

By the way, the custom event I set up wouldn’t work anyway because no matter what I do, the text becomes red ‘error’ text. If I choose Type: Event, I am warned that “You’re trying to change a list of Events”. If, however, I choose Type: User, I am warned that “You’re trying to change a list of Users”.

That’s because that’s exactly what you’re doing - from your screenshot you haven’t specified an event (or a User) to change - rather you’ve done a search for events, which will return a list of events (you’re searching for ALL events who’s date is after the current date/time) - hence it says “you’re trying to change a list of events”.

In order to change a singe event you need to specify a single event to change.

I have identified the issue to be that a scheduled event won’t allow me to ‘make changes to a thing’, it always forces me to make changes to a list of things. I have tried both custom and general scheduled workflows, and get the same issue.

I think you’ve misunderstood the error message - it’s telling you the opposite - that you are trying to change a list of things (when you should be changing a single thing, i.e. an event).

and now my workflow won’t let me select that custom event from the dropdown?

I can’t see from your screenshot, but it looks likely that you’re trying to schedule a custom event from within the custom event itself (i.e. create a loop) - which you cannot do in Bubble. If you need to do that then there are plugins you can use instead.

But again, from your original question, I can’t see why you’re trying to schedule a custom event at all here (unless I’m missing something) - you need to be using a backend workflow to achieve what your original question was asking about.

Here’s a basic outline of the process you should be looking at:

  1. Create a backend workflow, with a parameter for Event (of type Event), and an action to make changes to ‘Event’ and remove the users from the list of attendees.

  2. When your event is created, add a workflow action ‘Schedule API Workflow’ to schedule the backend workflow you created above, send the newly created Event as the Event parameter, and schedule it to run on the Event’s expiry date/time.

Agreed, although there are no coaching services that I have found.

How much coaching do you need? Bubble offers a whole marketplace for coaching

My rates would be substantially lower but I’m also not yet familiar with the entire ecosystem (backend workflows, custom domains, seo) and as such limit the work I take on. The pros offered by bubble have it all in their tool belt already!

Thank you again adamhholmes for the clear instructions. I have started learning about ‘Custom Events’ and now fully understand their use case.

Your instructions were excellent and I have almost succeeded. Thankfully you specified in your outline of the process that I’ll need to schedule an API Workflow, this was previously unintuitive to me because I thought an API was something referring to third party code.

Anyway, let me show you my progress now;

Step 1. I created an API workflow called “event-expired” with a type of Event.

Step 2. I made an action to make changes to ‘Event’ and remove the users from the list of attendees. I can only seem to remove a single User, so I’ll place it on the button “Going” which a single user would click (rather than applying the backend action to the main “Submit an Event” button).

step2 can onlly remove current  user

Step 3.

I applied the API workflow to the ‘Going’ button and scheduled a trigger date, but as you can see it doesn’t allow me to apply the action I require?

1 Like

Gotta love this forum community! :muscle:

Yeah, it is amazing. People are really supportive.

1 Like

You can only remove a singer User if you use ‘Remove’.

To remove more than one use ‘Remove List’

And to remove ALL users use ‘Clear List’ (or you can use ‘Set List’ and leave the value blank - i.e. set the list of attendees to empty).

Step 3.
I applied the API workflow to the ‘Going’ button and scheduled a trigger date, but as you can see it doesn’t allow me to apply the action I require?

The scheduled date needs to be a ‘date’ - i.e. the date of the event, or perhaps some time afterwards.

Currently you’re comparing the date of the event to the current date/time, asking if the event date is after the current date/time, which will evaluate to a ‘yes/no’ (either it is or it isn’t), rather than a date (which is why it’s red).

It needs to be a ‘date’, not a ‘yes/no’, so just set the scheduled date to the event date - or, if you want to run the workflow at some point after that, set it to the event date: +days (to add some additional days), or weeks, months etc.

Thank you, I am testing this now …

Brilliant, thank you that worked! I will outline the steps I took for anyone who is interested, but basically I followed your instruction.

I changed the API to remove ALL users from an Event which expires. The API workflow will now be applied to the “Create Event” button.

The API workflow ‘thing to change’ is Event with the following statement:

Going 
remove list 
This Event's Going

This will remove all users who chose to go to the event.

Next, I scheduled this API workflow on the “Create Event” button.

I have scheduled the date to be Date Picker's value + (days): 1

(during testing I scheduled the date to be Date Picker's value + (minutes): 1

The logic here is that the date picker is the date of the Event, so 1 day after that time should be good to Unjoin everyone so they can re-join to the posters next event listing.

I have made the Event input (in the API workflow) asResult of step 1 (create a new even...).

All worked :slight_smile:

1 Like