Do when condition is true, how does it work?

Hello guys,

So I´ve a situation where the user must be set to the status of “no” 14 days after he subscribed. Then after those 14 days he won´t be able to access the app so I did a workflow that sets the user status to “no” when current date time is > current user´s end date. This is set to just happen once.

The question now is that if the condition happens when the user access to the app (on page load) or is this happening in the background as the condition gets true?

I want it to happen in the background so when that condition gets true it happens.

Thanks a lot.

Well I´ve seen that this only happens on page load and what I want to achieve must be done with schedule an API workflow which is pretty complex for me.

The thing is that I need to change the status of the user to “no” after 14 days of the registration so I created a field called “enddate” but now I don´t know how to modify the status of every user that has the enddate = current date/time

Anyone knows how to do this. I thought it was going to be easy but this workflow things are really difficult to understand.

Thanks a lot.

I suggest writing up a bit more detail of how far you got, so we can focus on the problem areas.

This would be a search with a constraint, where you do a comparison of the date vs today. Don’t forget to consider hours and minutes, you may want to adjust the “current date/time” you are comparing with. A good approach is to test with different values and see if you covered the situations you want.

There is a workflow action “Make changes to a list of things”, give it the list from the search result from above, then pick the status field to modify and it’s new value.

Good luck!

Hey @ryanck,

Here’s what you need to do:

  1. Go to Settings > API > Turn on POST workflows

  2. Go to your page selection dropdown and at the bottom you’ll now see “API Workflows”

  3. Create a new endpoint. Name it “change_status”. Add a key: Subscriber = User. “Subscriber” is just a label you’re giving your key and “User” is the data type for this key. We’ll use this to be able to schedule the workflow for a particular user. Create the workflow: Make a change to thing, thing to change = Subscriber > status = no.

  4. Then, go to the workflow where the user subscribes. Add an action “Custom Events > Schedule API workflow” > Subscriber = Current User > Scheduled Date = Current Date/Time (+days) 14

Now, when a user subscribes, the API workflow will be scheduled to change the status to “no” after 14 days. Hope this helps!


Gaby | Coaching Bubble

5 Likes

Hello @romanmg,

Thanks a lot for your help!

So as I understand I need to create the endpoint first and then in the “register now” button create the workflow but as the user is right now being registered, how does the app know which one is the current user?

Thank you so much.

Bests.

Hi @ryanck,

Have the user registration action be the first in the workflow and it should know to grab this new user. Give it a test with a much shorter scheduled date like current date + minutes.

Thank you so much @romanmg,

It works.

Really well explained what you did, I appreciate so much that.

My bests.