0

I am working on a sharepoint online custom list, and the list contain these 2 main fields:-

  1. Status. drop-down with options; new,open,closed
  2. Publish Date.

now i want to prevent users from creating/editing an item and change its "Status" to "Closed" unless they specify a value for the "Publish Date".

now i want to use the modern experience, as if in classic mode i can simply add a script editor web part and do the validation using javascript. but what are the options i have to do this validation in modern experience ? and can i benefit from list or field validation to do such a validation (as list/field validation will work on modern UI)..

2

Add a list validation formula. I'll reword your request to make sure we are talking about the same thing:

Status cannot be 'Closed' if 'Publish Date' is blank.

  • Go to List Settings, and click Validation settings.
  • Enter a formula similar to this one:

    =NOT( AND( ISBLANK( [Publish Date] ), [Status] = "Closed" ) )

  • Enter an error message.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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