Validation of sharepoint list entry

Copper Contributor

Hi there. I have a list in SharePoint with the following 3 columns: "equipment", "from", and "to". The "equipment" column is a dropdown list where multiple equipments can be selected. The "from" column is a date and time field in the format dd.mm.yyyy hh:mm. The "to" column is also a date and time field in the same format. I would like to prevent a new entry from being added to the list if an equipment that has been previously selected is chosen again, and the value entered in the "from" field is greater than the previous "from" value for an existing equipment in the list, and less than the previous "to" value for the same entry of existing equipment in the list. For example, if on line 1 of the SharePoint list, equipment x and y are selected "from" 12.04.2023 09:00 "to" 12.04.2023 10:00, and on line 2 I try to select equipment x again and enter "from" 12.04.2023 09:25, I want the entry to be invalidated because the value entered is greater than the "from" value on line 1 and less than the "to" value on line 1. I succeeded to replicate it in excel but not a chance to find out how to do it in sharepoint

Thank you

3 Replies

@lexetordo you can't compare items in a list, so for example if someone has already selected Camera then it will still be available for all other items you create. You will need to do this with Power Apps as the front end and your SharePoint list as the data source.

 

Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)

Thank you@RobElliott 

So I could set this validation with Power Apps, which probably will give me a headache, but for sure I will bother you later about how am I gonna do it.

Stay close, thx!

Hi, again@RobElliott 

Following your advise, I set up an app. My level in Power App is -1, but I succeed to set it up 99% properly. I made all adjustments and now I need to add a validation in order to not let the user to add a new record if at least one equipment is selected for the same date between those times previously added by another user.
It would have been easier if only one equipment was selected, but since there could be more selected, I can't figure out.

You probably need some other info from me regarding the name of items used in app, but if you could just use whatever names you decide, I can handle to change them with the real ones. Anyway, I let here an image of EditScreen from Tree view

Thanks.