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.
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) .
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 .
Back at the table Table, you can now add a Custom Filter in your lookup date field (which you would find in Lookup options → Item 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).
@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:
@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??
@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:
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 … 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
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 )