Validation Problem at Form

Ok so… I’m not sure if this will do exactly what you wanted but to limit the number of times a date can be selected you would need to convert you Date select list into a Lookup field.
(Which can be done just by clicking on Convert into a table) :blush: .

Then, in the new table (in the sample below, the table is just called Date) add a Lookup field going from your table called Table to the Date table (technically, it’s the second part of the first lookup) which will gather the rows from Table where the date has already been selected.

You can simply do that by adding a column to the Date table by clicking on the + at the end of the table and in the menu which will automatically open itself go to Lookup → then select the table in referenced by

Now, still in the Date table you can add a field to count how many times the date has been selected in the table Table :blush: .

Back at the table Table, you can now add a Custom Filter in your lookup date field (which you would find in Lookup optionsItem settings) to indicate that a date should be selectable if the count in the Date table is less than 4 (if the date has not already been selected more than 4 times).

In the form, only the dates selected less than 4 times should appear as available options for your date field :blush:

@Pch
Thank you so much, I created a form with this table and published it, which I put the link below, the problem is that I can not select the date in this form:

@amin_jebeli : I think you might need to toggle On the Include all lookup columns in the Privacy settings of your form … as stated by the tooltip :blush: .

(Be careful though to not store sensitive datas in the Date table).

@Pch
Thank you so much, what should i do with this error:

Still in the Privacy settings you need to toggle OnAllow submissions :blush:

@Pch
If I do not refresh the form and after submitting a request on a date that has more than 4 of them in the table, I can still submit the request on that date until I refresh the form and that date from the list of selected dates Exit, why should i do, if i do not want to refresh the form??

I’m sorry but why would you refresh the form ? :thinking:

@Pch
Suppose there are 4 dates in a table, then this date can be selected in the form because the number is less than 5, now when I select this date for the fourth time in the form and register my request, with Click on submit another entry button I can still select this date until I refresh the form and can no longer select this date For example there are now 4 of this date:
1

I chose this date for the fifth time:

I clicked on this button:
2

Then I was able to choose this date for the sixth time:
4

But only after I refreshed the form, this date no longer existed, otherwise I could still click on the submit another entry button and select this date again:

Oh, I see :thinking: … I guess this might be due to some delay in between the moment the form was submitted (and the new entry created in the table) and what the form now reads from that table …

You could potentially disable the Submit again under Confirmation (in the form settings)… This would also mean people won’t be able to re-submit a new entry just after submitting one (not without refreshing the tab/window at least, which should leave to time to Coda to update everything behind the scene…)

@Pch
you are wonderful, thank you for your huge helps

1 Like

No problem @amin_jebeli :blush: !

Always glad to help when I can :blush:

@Pch
Suppose I have all the dates from the beginning to the end of the year in my table, but when users are selecting the date in the form, I want them to select the dates that are from today onwards and not be shown the dates of the previous days. What should I implement in this form or in this table ??

Well first, you should change your Text field containing your dates in the Date table to a Date type of field (to use real dates instead of text ones) … Then, in the Date lookup field in the table Table you can add another Custom filter with a formula looking like this : Date >= Today() (note that Date is in fact TableDate.ColumnDate :innocent: )

2 Likes

@Pch
Thank you again

Hello @Pch ,
I have done quite a bit of experimenting and testing to get a booking system working and as far as I could see, it doesn’t have to do with refresh time but with the way a form is loaded. The lookups are static (in my experience) when you open a form and regardless of the waiting time, it does not reflect changes made by the last entered form until you refresh the form.
The solution is indeed to not allow a user to resubmit another entry from the current form session.
Greetings, Joost

1 Like

Hi @joost_mineur :blush: !

This makes so much more sense than what I previously said :blush: !

Thank you very much for your insight here :grin: !

@Pch
Today I got a new error, I fill in all the fields of the form and after clicking on the submit button, I get this error, what should i do???

Bump! Getting a similar error. Cannot figure out why.

@anon49092417 : There was a bug :bug: :blush:

… which has been fixed :grin: !

2 Likes

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