0

Can I set a field as mandatory if the field is dependent on the status?

Below is the form to insert information for a new plan. How to set Purpose of Visit field as mandatory.

enter image description here

If I use the below condition, it will no longer dependent on status:

enter image description here

1 Answer 1

1

You can make the "Purpose of Visit" field mandatory in case the Status field is equal to "Planned" using SharePoint list validation formula.

You can use the SharePoint list validation formula like:

=IF([Status]="Planned",IF(ISBLANK([Key Activity/Purpose of Visit]),FALSE,TRUE),TRUE)

OR

=IF([Status]="Planned",NOT(ISBLANK([Key Activity/Purpose of Visit])),TRUE)

You have to add this formula under List Validation settings.

Follow below steps:

  1. Go to SharePoint list
  2. Click on Settings icon and select List settings
  3. Select Validation settings
  4. Add formula & user message and click Save

Similar thread: Validation Column Not Working


Note:

  1. Sometimes comma(,) does not work in formula (It is based on language or regional settings of your site). So in that case use semicolon(;) instead of comma(,).
  2. Make sure you are using correct display name of your columns in the formula

Update from comments:

Unfortunately, you cannot use Multiple lines of text columns in SharePoint formulas. This is a limitation of SharePoint by design.

In that case, you will have to use the Power Apps customized list form to make the "Key Activity/Purpose of Visit" (multiple lines of text) column mandatory.

Documentation: Customize a Microsoft Lists or SharePoint form by using Power Apps

17
  • But I have already the below validation
    – Nehad
    Aug 28, 2023 at 17:37
  • =IF(AND(Status="Completed",OR(ISBLANK([Planned Start Date]),ISBLANK([Planned End Date]))),FALSE,AND([Planned End Date]>=[Planned Start Date],[Actual End Date]>=[Actual Start Date])) How I fit the above condition
    – Nehad
    Aug 28, 2023 at 17:37
  • Try something like this: =IF([Status]="Planned",NOT(ISBLANK([Key Activity/Purpose of Visit])),IF(AND([Status]="Completed",OR(ISBLANK([Planned Start Date]),ISBLANK([Planned End Date]))),FALSE,AND([Planned End Date]>=[Planned Start Date],[Actual End Date]>=[Actual Start Date]))) Aug 28, 2023 at 17:51
  • I received this message-Sorry, something went wrong
    – Nehad
    Aug 28, 2023 at 17:54
  • Any solution dear?
    – Nehad
    Aug 28, 2023 at 18:05

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.