Validation Problem at Form

I have a table that counts the number of repetitions of history in the lookup column. I have created a form with this table and I want it not to allow the person to select that date if it was selected in a historical form that had more than 4 in the table.

Table Link:

Form Link:

can anyone help on this??

@amin_jebeli : We can’t access you doc at the moment :blush:

Would you mind checking in ShareGet link if Anyone with the link is set to Can view

you have access now, here you are:

I’m sorry but I still don’t @amin_jebeli

When I click on the link you shared, Coda is asking me to sign in, which is absolutely not needed (as I’m always logged into Coda :blush: ).

Can you click on Copy doc link (in ShareGet link) and share that link here :blush:

if you don’t have access yet, please give me your email, but i did it again:

please try this one too:

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:

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).

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

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

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:

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:

I chose this date for the fifth time:

I clicked on this button:

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

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…)

you are wonderful, thank you for your huge helps

1 Like

No problem @amin_jebeli :blush: !

Always glad to help when I can :blush:

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: )