Forum Discussion
StillLearning
Oct 10, 2020Copper Contributor
validation formula to check if DateTime of new item is within DateTime of existing item
Hi everyone,
I have spent an exceptionally long time looking for a way to do this and can't find one (not one that I can use/understand anyway!). What I want to do is;
in a SharePoint List I have 3 DateTime columns (because there is no way to have a single column that allows a user to enter date and 'between times' i.e. 7-Oct-20 3:00PM - 4:00PM) and an 'ID' column.
I want to stop users from creating a new item if the DateTime columns in the new item fall within the period of the existing DateTime columns, if the 'overlapping' DateTime columns have the same item ID.
EXAMPLE:
ID Column | Date 1 | Date & Time 2 | Date & Time 3 |
5555 | 5-Oct-20 | 5-Oct-20 4:00PM | 5-Oct-20 8:00PM |
7777 | 5-Oct-20 | 5-Oct-20 5:00PM | 5-Oct-20 6:30PM |
5555 | 5-Oct-20 | 5-Oct-20 7:00PM | 5-Oct-20 8:00PM |
In the above example, I want to stop the user from creating that item (and have an error message or similar come up to say "time already exists" or something to that effect)
Does anyone know how I could achieve this (either by using a 'Flow' or column validation)??
Any assistance would be greatly appreciated!!
No RepliesBe the first to reply