validation in a grid

How can I add a validation on an input grid to ensure that the data being added does not already exist in the grid ?
I've a small table in the database, which contains 5 or so fields. field1 is a date field.

Within Appian I've an interface which has an editable grid - to allow the input of more data into this table.
I'd like to add a validation on the date field input, so that if the user selects a date that already exists then he'll get a validation message to show it's already been used and exists in the grid.

I've tried several things within the validation and not having much luck.
for example something like ?

a!foreach(  
                 items : local!dataset.Date
                 expression: if (fv!item = local!dataset.Date),
                                            "DATE IS USE",
                                             {}
)



 Discussion posts and replies are publicly visible