0

I'd like to add an unique constraint to a list that has a Date field.

I want to restrict a user from adding two records with the same date.

I tried creating a computed [Created by] & [Date] Column so I can enforce uniqueness but I think that [Created by] being a special column prevents this.

Any hints on how to achieve this?

1 Answer 1

1

The way I would tackle this is by customising the SharePoint list form with PowerApps.

In the form, you can build logic that queries the list, filtered by the Date and current user and counts the resulting rows. If the result is 0, set a flag variable to "True" and let everything continue. If the count is greater than 0, show a text box that says "Sorry, you've already submitted an item today" and set the flag variable to "False".

You can change the "OnSave" property in the SharePoint Integration section to only submit the form if the flag variable is "True".

In the SharePoint list settings > Advanced Settings > disable editing the list data in grid view and side panel, so users must use the list form with the logic to enter new data.

If you are new to PowerApps, this will give you a deep dive into its functionality and possibilities.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.