SharePoint List conditional formula "if" "Or"

Muki 76 Reputation points
2022-12-14T17:21:30.64+00:00

In the [$IncidentType] selection box i have the following selections

"privacy"
"Compliance"
"Consult"
"Audit"

and the form works correctly to hide / show fields. What i'm wondering is can the formula be adjusted so that the if the user selects "privacy" or "consult" that the field will show or hide.

=if([$IncidentType] == 'Privacy', 'true', 'false')

270712-image.png

Microsoft 365 and Office SharePoint Server For business
Microsoft 365 and Office SharePoint Development
Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} vote

Accepted answer
  1. Yi Lu_MSFT 17,611 Reputation points
    2022-12-15T03:05:47.35+00:00

    Hi @Muki
    You could use the following conditional formula:

    =if([$IncidentType] == 'Privacy'||[$IncidentType] == 'Consult', 'true', 'false')  
    

    As a result, when the field in "IncidentType" column, the conditional column will be shown, otherwise will not.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    7 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Muki 76 Reputation points
    2022-12-15T16:19:00.32+00:00

    AWESOME! it worked!

    2 people found this answer helpful.
    0 comments No comments

  2. Fernando Juan Jarque 20 Reputation points
    2023-10-18T13:25:35.02+00:00

    Hi @Yi Lu_MSFT !

    I have a question I hope you have the solution. I created a SharePoint list with a multi-choice field called "Equipo" that can take several values at the same time. I have tried the following:

    "background-color": "=if([$Equipo]=='FA','#FFF3D6',if([$Equipo]=='GC','#DEF7EB','#E7E7EE'))"
    

    It worked when "Equipo" was a Choice field. However, I needed this field to be multi-choice, and now it is not working. I would like that if Equipo has one option, card looks with a particular color. Otherwise (several options selected), in white.

    Where is the issue?

    Thanks in advance

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.