Conditional formatting on Sharepoint List for a Boolean field
I am creating an onboarding/new hire Sharepoint List at one of my clients and wanted to display a column/field only if a box is checked.
To do this, I created two columns:
ReplacementHire= Boolean Yes/No checkbox
PreviousUser= Text field
I wanted the
PreviousUser field to only appear if the
ReplacementHire box is checked.
To do this, I opened my Sharepoint List and did the following steps:
Click on the New button on the left side of the page.
In the Form view, click on the book/edit icon at the top right and click “Edit columns”
- Click on the three dots next to the column that you want to hide. Click “Edit conditional formula”
In the popup window, paste in the following:
=if([$ReplacementHire] == true, 'true', 'false')From what I gather, the
ifstatement reads, if the box is checked (true), then 'true' (meaning display the field), else 'false' (if not, hide the field).
Click OK and then Save. Refresh the page and test.
There was also some headache in the field/column name. What you typed in originally for the column name will be the “anchor” or name in the URL.
To get this anchor, do the following:
Navigate to the Sharepoint site, click on Site Contents.
Find the form, click on the three dots, and click Settings.
On the Settings page, click on the column title under the Columns section.
On the Column setting page, check the URL in your browser for anything after
&Field=This info will be the “anchor” that you use for the
=if([$anchor] == true, 'true', 'false')in the Conditional Format window.
Just putting this here for my future reference.