Updating "Days left" daily automatically without users taking action

I am developing a subscription app. Where user has a start date and end date (monthly subscription). I want app users to see the days left to their subscription.

I can easily do this with a text element (by calculating current date and expiration date). That’s not a problem.

There is a field in “Subscription” data type which is “Days left”. I want that field get updated everyday automatically.

I used workflow “When Log In” that change the data when users log in. Or page is loaded. That changes the field and not a problem.

But when nothing of those happens like page is not loaded (Single Page App) or user is not logged out or not logging in everyday but date changes, how can that field get updated?

Is it Backend Workflow that will update the days left automatically? I can calculate the days left but how can I achieve this? Since users location may vary.

Need help. Please add all the possible options that you think will solve this.

You can set up a recurring event that will run every day and set the updated value.

I think it’s going to give you problems at some point and it’s not a good idea.

What it is the use case for this field?

2 Likes

Thank you very much @dorilama for your prompt reply.

Depending on days left of an user’s subscription, various actions can be applied like sending email on specific days of the subscription to motivate users to buy credits if they are finished with their quota of usage or anything promotional. Or any updates etc. And other workflow actions will be stopped if there are no days left like making external API calls or anything that are related to subscription. Or To change status.

Hope it makes clear. Please let me know if you need more clarity.

What about creating a custom event that calculates and update the field and associate it with every action user takes inside the app like clicking any button anywhere? It will not happen automatically but will ensure there is no access usage. Will it be a good idea?

You can schedule a recurring workflow to run every day and trigger other workflows from that, but on many workflows you can just calculate the days left.
sending email on specific days → when you create a subscription schedule a workflow to run on current date + x days to send a notification. If you want to send it only if the user finished the credits set that in the condition of the scheduled workflow
some action need to be stopped → calculate days left in the conditition of the action/workflow

At the end of the day you decide what method works best for your use case

2 Likes

This is probably a bad idea because you still depend on the user to calculate somethng that depends on elapsing time and you will probably end up calculating it too many times

2 Likes

Great inputs from @dorilama, I agree with him

What you want to do can be easily implemented in the backend workflows and there are also multiple ways to do it! Like what he said, it depends on your use case and how you wish to implement it i.e. recurring workflows, API workflows that trigger themselves

1 Like

Thank you very much.

Thank you I think it will solve the problem. Thank you for your time. :slightly_smiling_face:

Happy to help :slight_smile:

1 Like