Comparing Database Values in Workflow Conditionals?

How would I go about comparing data from two different database fields in a conditional workflow rule, then updating the value of one database field with the value of another databases field? :thinking:

I think I need to do this as a custom rule which I can then run as a recurring event. The objective is to award subscribers with the amount of tokens relevant to their subscription package each time their subscription enters a new billing period. Here is the logic I am trying to achieve:

If Stripe database field “Last Payment Date” <> Stripe database field “Token Allocation Date”
Let User database “Tokens” field = Stripe database field “Package Tokens” AND
Let Stripe database field “Token Allocation Date” = Stripe database field “Last Payment Date”

Hi there, @blogshackltd… I could easily be missing something here, but if I understand your post correctly, it sounds like you might be making this one more difficult than it needs to be or possibly just overthinking it a bit. I mean, you know the date on which a user’s subscription enters a new billing period, right? So, when a user signs up (or activates a subscription), schedule a backend workflow to run on the renewal date, and have the workflow update the user’s tokens field if the subscription is still active. Then, have the last step in that workflow schedule the same workflow to run again on the next renewal date.

Who knows, maybe we are saying the same(ish) things here, but I’m not sure why you need to check those dates when it sounds like scheduling a backend workflow would do the trick.

Hope this helps.


1 Like

Thanks Mikeloc, that definitely sounds easier to implement, my only concern with that approach is if there is an outage with Stripes API, the renewal date would be in the past so the whole system would fall over.

Sorry, I’m not following… an outage with Stripe would have nothing to do with whether or not a scheduled backend workflow would run in Bubble. Also, if there are regular outages with Stripes API that cause your system to fall over, then you (and pretty much everyone else) have much bigger fish to fry.

What I meant is, imagine an outage/delay prevents the last payment date from updating in my database, the scheduled task runs anyway because its time for it to run, but then it sets the date for it’s next run as the last date in the database, which would be a date in the past, so it would never run again until it was rescheduled for every affected user.

You are probably right, I might be overthinking it…

1 Like