Conditional field as per option selected

Copper Contributor

Hi team,

I am not sure if this has been posted before or not. I had a look at the other posts but couldn't find the solution. 

I am trying to create a simple Change management tracking in Sharepoint where user can submit  change request for reviewal. What I am trying to setup is when the Change category (drop down field) selected to Medium, it should make "Technical review by" (user field) mandatory. 

Riz_K375_1-1687765374734.png

 

Riz_K375_0-1687765343434.png

Similar I will setup for the Major change as well.

Currently I have this field available but did not make it mandatory as there is other options like "Minor" and Standard which does not require technical review.

 

Further in the details, I have created a flow which send an email to the person selected in Technical review which seem to be working fine. 

 

I will appreciate if someone can assist how I can achieve this task. Thanks

15 Replies

@Riz_K375 

 

  • Go to list settings-> Validation Settings.
  • Write in the formula to validate

=IF(Category="Medium",IF([Technical Review By]<>"",TRUE,FALSE),TRUE)

 

tdprem_0-1687774088084.png

 

tdprem_1-1687774088086.png

Kindly mark as answer after reviewing the answer.

-

Thanks,

Prem

Premkumar T D | LinkedIn

Hi @tdprem ,

Thank you for your response. I just tested your solution and I am getting below error:
"Sorry, something went wrong
One or more column references are not allowed, because the columns are defined as a data type that is not supported in formulas."

Is that because your Technical Review By is a text field and mine is Person?

Yes person or user column will not work out for this.
Any other suggestion which we can try to make it work?

@Riz_K375 Person or group columns are not supported in list validation formulas.

 

Also, currently there is no other SharePoint out of the box way for your requirements. So, you will have to customize the list form using Power Apps to achieve your requirements.

 

Check below documentations/links for more information:

  1. Customize a Microsoft Lists or SharePoint form by using Power Apps 
  2. Customize a form for a SharePoint list 
  3. Make a field required based on another field 

Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Thank you Ganesh and apologies for the long delay.
Ok so we know that we cannot use Person field for validation. I am thinking for using the text field instead which can fill Person.
Is it possible if a user name filled in text box can fill the Person field. It is just to make sure user name is filled correctly so the flow can trigger for approval?
In another scenario if Person field  is filled it can fill the text field?

@Riz_K375 You can fill email address in list instead of user name. 

 

Then when flow runs on the list after item creation, you can use Office 365 users connector to get all the details of user based on email address in the list.

 

Then you can use those details to send emails / approvals and fill person field in the list.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@tdprem  why the formula is having error 

=IF(Budget Shift Needed="Yes",IF([Budget Shift EURO]<>"",TRUE,FALSE),TRUE)

Melow28_0-1714129893239.pngMelow28_1-1714129948604.png

 

@Melow28 

 

You have to wrap the column names in square brackets if there is space in the column display name, like [My Column Name]. Try using formula like: 

 

=IF([Budget Shift Needed]="Yes",IF(ISBLANK([Budget Shift EURO]),FALSE,TRUE),TRUE)

 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@ganeshsanap I tried above formula it does not work , The a Euro Value should not be required since I selected no

Melow28_0-1714651334977.pngMelow28_1-1714651381500.png

 

@Melow28 

  1. Open settings of "Euro Value" column
  2. Make it non-mandatory like: ganeshsanap_0-1714657649565.png

Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@ganeshsanap Got it, what if I want to make additional conditional that if Budget Shift Needed is "YES" also the FTE and Build up location should be mandatory.

 

Also, The if Budget Shift Needed is "NO" the Euro Value, FTE requirement, Build up location should not be visible or grayed out is that possible? 

 

Can you please recheck formula as I'm having error cannot save it 

=IF([Budget Shift Needed]="Yes",IF(ISBLANK([Euro Value]),IF(ISBLANK[Build up location]),IF(ISBLANK[FTE Equivalent]),FALSE,TRUE),TRUE)

 

 

@Melow28 Use formula like: 

 

=IF([Budget Shift Needed]="Yes",IF(OR(ISBLANK([Euro Value]),ISBLANK([Build up location]),ISBLANK([FTE Equivalent])),FALSE,TRUE),TRUE)

 

For conditionally hiding fields from list form, check this documentation: Show or hide columns in a SharePoint list or library form 

 

Note: Showing/hiding conditional formulas works with internal name of SharePoint list columns and not display name. 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@ganeshsanap it works thanks for the formula . This is the other one I mentioned if Budget Shift needed selected as "No" then Euro Value, FTE and Build up location is hidden. Would you know how to enter correct formula?

Melow28_0-1714746342758.png

 

@Melow28 You have to use formula like: 

 

=if([$BudgetShiftNeeded] == 'Yes', 'true', 'false')

 

Where [$BudgetShiftNeeded] is an internal name of your column in SharePoint list in this format: [$InternalNameOfColumn]. You can get the internal name of your SharePoint list columns by following this article: How to find the Internal name of columns in SharePoint Online?

 

Note: if/true/false should be in small letters and use single quote around true/false as given in above formula.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.