If any data is repeated, how to hide a reference table?

I have a reference table in this app to enter daily attendance information.


For a single name per day, data can be collected multiple times through the main form.
image
I want to make this attendance reference table one time active per person per day.
Simply put, the attendance table can only have one record per person per day.

What expression should be written for “Show _if” in the main attendance related virtual field in the main form?

There are a couple of approaches you may use.

  1. The easier but somewaht not so elegant is to add a duplicate preventing valid_if expression in the [Attendance ID] column of the attendance table.
    The expression in valid_if of [Attendance ID] in child “Attendance” table can be something like

ISBLANK(
FILTER(
“Attendance”,
(AND([_THIS] = [Attendance ID], [Name with Initial]=[_THISROW].[Name with Initial]))
)
- LIST([_THISROW])
)

Here “Attendance” is name of the Attendance table. Please change suitably.
This will prevent more than one child record being created for the same day per person. However, it will NOT hide the “New” button after adding one record in the attendance table.

Please take a look at the last part of the article below on duplicates prevention approach.

  1. There are more elegant ways but a bit cumbersome to implement. I will post references to those soon.

Edit: Please refer posts below

https://community.appsheet.com/search?q=disable%20child%20add%20button

Edit: Some edit to expression to make it person specific.

2 Likes