2

I working on to have a validation on a SharePoint list. One of the requirement is in Column A it should not contain serial number which are the numbers that in a manner only differ +1 from one another.

For example in column A:

WS2228890615

WS2228890616

WS2228890617

WS2228890618

WS7725700677

WS5825890658

In this example, the number in top 4 rows only differ +1 and should return error in validation.

I have found a way to extract separately the number from the character. But still need help on how to compare the different between rows to detect the +1 different and return error.

Hope to have a help form the community. Thanks in advance.

3
  • On new/edit form you can write custom javascript. And use PreSaveAction function. In this function you can use your custom valudation code (i.e. get existing data from list and compare with the current value and all.....) Apr 9, 2020 at 7:23
  • And the 2nd way is to write event receiver. As you are using using SharePoint-Online you will have to write a Remote-Event Receiver to achieve this. This will require to setup app environment and all.. Apr 9, 2020 at 7:27
  • @RohitWaghela ,on new-->edit form, then I just get 'edit column' and 'customize with PowerApps' option. In edit column option I just able to rearrange the column arrange ment up and down in the form. Could you please explain where I can writet he custom java script?
    – Nas
    Apr 10, 2020 at 3:12

1 Answer 1

1

Per my knowledge, you may need to use a event receiver to query all the list items for the specific column and check if there are items have the filed value in the range (new value ± 1). Column validation or calculated column will not be able to help you.

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.