Restricting number of appointments

I created a scheduling app for students to select consultation slots for seeing their teachers. The App has a Students table and a Slots table. teachers broadcast their availability on the slots table indicating the days and times they are available. Students can select slots for times to see the teachers.

How do I restrict students to only selecting only One slot per week?

0 9 542
9 REPLIES 9

You should be able to use the โ€œValid Ifโ€ to say that its only valid if itโ€™s + or - 7 days from another one of their appointments. Are the Slots Date Fields?

One way is to create a key column with a combination of studentโ€™s name (or email address), week number and year. If the same user tries to add a new record, it wonโ€™t be possible because that key value is already used.

@Aleksi - interesting approach. Would you still be able to use an Invalid value error
Error message when the key is already existing (as there is no ValidIf on the key col)? What error message would the user see?

I believe the message is an Appsheet generated one you get when a key already exists.

@Mike Yes because the key column error you will see when you try to save the recordโ€ฆ not when you fill the value. This would mean that you can create your own error message with the Valid If.

And the formula could be like AND(TRUE,NOT(IN([KeyColumn],TableName[KeyColumn])))

Steve
Platinum 4
Platinum 4

@Aleksiโ€™s idea is nice and easy. The hard way is to adapt your Slots table as follows:

Slots (table)

When (column)
  • Type: DateTime
  • Required? ON
Teacher (column)
  • Required?: ON
Student (column)
  • Valid If:
ISBLANK(
  FILTER(
    "Slots",
    AND(
      ([Teacher] = [_THISROW].[Teacher]),
      ([Student] = [_THISROW].[Student]),
      (WEEKNUM([When]) = WEEKNUM([_THISROW].[When]))
    )
  )
  - LIST([_THISROW])
)
  • Required?: ON

Many thanks for the responses. I used the expression in the last response and it worked very well. How does one include a user manual within an app?

The easiest way could be a โ€œeBookโ€ functionality where you add a table view with section names and when the user wants to read that section, the app will show a detail view with all data in it.

Top Labels in this Space