Forum Academy Marketplace Showcase Pricing Features

Date logic to hide element after one month

Hi guys,

I have an element which I want to hide if the user has been signed up more than a month. So, after one month I am hiding the element, is this correct??

date

No… that will hide the element when the User has existed for less than 1 month… which is the opposite of what you’re trying to do.

You need to use the opposite, i.e. When User's Creation Date +(months) 1 < Current date/time

…although it’s worth pointing out that the User’s Creation Date is not the same as the date they signed up…

So if you specifically want to hide the element when the User has been signed up more than a month you’ll need to add another date field to the User datatype to store the date they signed up to your app.

2 Likes

Ah perfect, thanks @adamhholmes and thank you for pointing out that the User’s Creation Date is not the same as the date they signed up, I’ll work around that.

1 Like

The User’s Created Date does appear to be the same as the date they signed up (see below). I think this is all I need, or am I missing something?

The User’s Created Date does appear to be the same as the date they signed up (see below). I think this is all I need, or am I missing something?

Yeah, obviously if the User signs up on the same day they were created in the database, then they’ll be the same day (but not the same timestamp)… but in reality that’s very often not the case (although I guess it depends on how you attract users to your app)…

A User can be created in the database up to 3 days before they sign up, so in reality there will very often be a difference of 1-3 days between the User created date/time and the date/time they sign up for your app.

So it depends on what you need to do and if a discrepancy of up to 3 days is an issue for you… if you don’t need to be that accurate then you can just use the created date (it will never be more than 3 days out from the sign up date)… but if you need to be accurate then a separate field to store the sign up date will be needed.

Ok that’s fine because a discrepancy of up to 3 days is no issue in this particular case. Thanks again for clarifying :slight_smile:

Fair enough, if that’s what works in your use case then great… I might urge some caution with that approach though…

I’d consider it a fairly important (and very simple) thing for any app to accurately store the date a user signed up, especially if there are any kind of legally binding Terms Of Use agreements between you and your users (which of course there should be)…

If the date you’re storing for when that agreement was made is different from the actual date the user made the agreement (or worse still, you’re not storing the date at all), then for one thing it could potentially void any such agreement altogether, or at the very least leave you open to legal problems if there are any disputes raised about the agreement or the use of your app by the user.

Also, for GDPR purposes, I’d always ensure I’ve got some accurate way to know when a user signed up for my app, agreed to our terms of use, and gave consent to store their details.

We always keep accurate records of all user interactions with our apps (first contact, email sign up, sign up as a user, subscription created, subscription changed, or cancelled, etc. as well as records of all agreements of our terms, and updates to our terms etc.), partly for our own accurate record keeping, and partly to help with any disputes about payments, membership, or agreements (of which we’ve had a few - especially from customers trying to pull a fast one saying then never agreed to certain things)… if we have accurate records to prove otherwise it usually prevents any further legal action from them.

Obviously, I’m not a lawyer, so don’t take any of that as legal advice (consult your own legal team for that), but it might be worth thinking about (especially for something so simple to implement).

That’s great information, you make some good points thank you, I will add a field to record the exact signup date. Out of interest, what is the ‘Created Date’ for if not for the date of the accounts creation?

Something isn’t working with this setup, I wonder if you can spot where I am going wrong… bare in mind, I will soon remove the ‘Creation date’ and replace it with a custom ‘signup up date’ field as per your advice.

  • For clarity, my users get one month free before they must subscribe to a payment plan.
  • When a user signs up, I mark them as “No” in the database field ‘trialExpired’. After one month from the signup date I want that field to change to “Yes” so that I know they have used their one month trial.
  • I’ve created a back end workflow to handle this and (as a test) I have set it to change the database field after 1 minute, but it never changes the field?

Screenshot 2022-08-11 082019

If I have a text element which says “You are on your trial”, I can successfully change that to “Trial expired” using the condition Current User's Creation Date +(minutes):1 > Current date/time so the issue is with the backend setup.

The ‘User Created Date’ is the date/time the User record was created in the database (i.e. the moment they first landed on a page in your app)… if they don’t sign up, then they’re stored as a temporary User for 3 days before being deleted… so if they land on your app at 10:13am on Saturday, that will be their ‘Created Date’. If they then sign up at 9:25pm on Sunday, that will be their sign up date…

  • I’ve created a back end workflow to handle this and (as a test) I have set it to change the database field after 1 minute, but it never changes the field?

No, you haven’t… it will change the trialExpired field to ‘yes’ the moment that workflow is triggered…

How are you triggering/scheduling it to run?

Ah that makes sense, thanks.

No, you haven’t… it will change the trialExpired field to ‘yes’ the moment that workflow is triggered…How are you triggering/scheduling it to run?

I didn’t know that I needed to trigger it - I have no experience working with the APIs in this way as you can tell! I will do some research.

Yes, you need to trigger it using a ‘Schedule API Workflow’ action…

Presumably, you’ll want to do that in whatever workflow you run when a User signs up, and schedule it for one month from that date/time…

All sorted! Thanks @adamhholmes

1 Like