Show fields in SharePoint Form based on value in a field

Anonymous
2022-03-28T01:53:04+00:00

Hello - I am trying to show/hide fields based on a specific field. I have A field called Category which is a dropdown containing 5 options. All categories will have the same fields except for one "Sales, Marketing & Advertising". I have put in the conditional formatting =if([$Category] == 'Sales, Marketing & Advertising', 'true', 'false') on several fields . The field checkbox turns gray letting me know the formula is correct, but when I select "Sales, Marketing & Advertising" while entering a new item in the list, the fields do not show up.

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2022-03-28T09:17:44+00:00

    Hi MsDeeC,

    Thank you for posting your query in our community.

    Per your description, you have problems about the show/hide field in SharePoint list. However, I tested with the same formula on my side, there was no problem. You can check below images:

    When I select other options, the field doesn't show:

    When I select "Sales, Marketing & Advertising", the field shows:

    Given this situation, could you please provide a full screenshot of your formula for me? And if you apply this formula to another list, will it work?

    Best regards,

    Jazlyn

    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2022-03-28T17:36:28+00:00

    Thanks Jazlyn! I tried this over and over last night and it wasn't working. I restarted my computer this morning and now everything is working as expected. Thanks for the validation! Another question, is it possible to base it on 2 options like if Category ='Sales, Marketing & Advertising' or 'Administration' then show these fields?

    0 comments No comments
  2. Anonymous
    2022-03-29T05:50:00+00:00

    Hi MsDeeC,

    You can try the below formula: =if([$Category] == 'Sales, Marketing & Advertising' || [$Category] == 'Administration', 'true', 'false')

    Best regards,

    Jazlyn

    0 comments No comments
  3. Anonymous
    2022-03-29T20:38:01+00:00

    Thanks Jazlyn! This worked! Do you know if there is a list of "operators" out there that I can reference? For example, if I needed to apply this conditional formatting to include others such as show these field if Category = Sales, Marketing & Advertising' and Site = 'San Francisco'. What is the correct term for these types of controls?

    0 comments No comments
  4. Anonymous
    2022-03-30T04:04:33+00:00

    Hi MsDeeC,

    You can check below official articles:

    Show or hide columns in a list form | Microsoft Docs

    DAX operators - DAX | Microsoft Docs

    Best regards,

    Jazlyn

    0 comments No comments