Default Date when user doesn't adds a date

I am creating a membership entry app, wherein there’s a dropdown having three values

  1. If the dropdown value is selected as “Only Membership”, then Enter Personal Training Details section is not shown to the user
  2. If the dropdown value is selected as “Only Personal Training”, then Enter Membership Details section is not shown to the user
  3. If the dropdown value is selected as “Both Membership and Personal Training”, then both the sections are shown to the user. For this case it’s working as expected

Say if it’s use case 1 above, I want the Personal Training Start and End Date to be blank.
I have selected the default value as none, however some random date is being stored in the database. What can be done to solve this ?

Hey Nitish,

That’s weird, it’s got to be grabbing the random date from somewhere. Otherwise it would stay empty. There must be an action that is somewhere updating it.

Check the automatic field submissions on the form?

What are the random dates? Is there any patterns?

Hey @barrettnash I just noticed that it’s holding onto the previous value.

Without selecting any dropdown value this is how it looks onto the app:

And if any one section gets hidden after selection of dropdown, the previous value is stored into the current user’s profile :slight_smile:

How can this be resolved ?

Hmmmmm

Is there always going to be a membership start date?

are you using adalo forms or creating each field yourself? I know forms store that info sometimes, but if you create each input field yourself it should work (unless you select an option, fill it out, then select another option from the dropdown. in those cases it could store the info)

Yes. There will always be a start and end date

Hey @axme, no this isn’t the form component. I created this myself using the date picker and text fields

Hi Nitish,

Sorry, I may be having a brain dead moment. I don’t really understand the issue.

Is the issue that it’s visualizing a ‘demo date’? In which case I don’t actually know of an easy way to have it be ‘blank’ since the date picker component comes prepopulated with a date in it, which is fairly common on all web forms.

Or is the issue that it’s saving an incorrect date into the database?

@barrettnash it’s entering a wrong date into the database.

Let me explain what’s happening with a scenario
There are three dropdown values, Only Membership, Only Personal Training, Membership and Personal Training

  1. If a user selects dropdown = Membership and Personal Training, all the fields are visible to the user.
    Say he selects membership start and end date as 1st July and 31st July resp.
    And, personal training start and end date as 1st August and 31st August resp.
    On submitting, this data gets stored in the database. This works perfectly fine

  2. For the next member, user selects dropdown = Only Membership, hence the entire personal training section get’s hidden from him. So he can enter only membership details.
    Now, say the user selects membership start date and end date as 2nd July and 30th July resp.
    So ideally, personal training details should be blank.
    But what’s happening is that personal training start and end dates are saved as 1st August and 31st August resp. (which was used for last member)

I hope you get the issue now

Interesting. I believe I understand the issue now.

What about as a work around having a default date, like signup date being defaulted to current time, and end membership be in like six months?

Note that this is likely an issue users will not experience since they will only go through this once. It’s the fact that you’re going through testing multiple times that you’re seeing it. But I understand you want it to work properly.

Hey @barrettnash, no it would be difficult to have the start date as sign up date because in the use case I am doing it, it’s a frequent activity. Also there are many cases where sign up date won’t be the created date

I understand this, it’s a work around: it would just be a cleaner place holder since there needs to be some date preset.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.