Show or hide columns in a list or library form

Show or hide columns in a list or library form

Conditionally show or hide columns in a SharePoint list

By in SharePoint, SharePoint Online on August 17, 2021September 7, 2021
No comments

2,987total views, 6views today

In this conditionally show or hide columns in a SharePoint listarticle, we will learn how to show or hide columns conditionally in the SharePoint list form.

Conditionally show or hide: what you will learn from this article?

  • How to conditionally show and hide the column in SharePoint Online list form?
  • How to conditionally show or hide columns conditionally in SharePoint list or library form?
  • What are the supporting columns for the conditional formula in the SharePoint Online list or library?
  • Unsupported column types in conditional formulas.
  • How to work with logical operators in a conditional formula of SharePoint Columns?
  • Conditional formula example with the allowed SharePoint column types.

In order to complete this demo, we need to have a Sharepoint list.

Here is the demo list, named Expense Claim

Below attached the list definition. Along with the IsApproverNeeded(Yes/No type) and Approver Name (People/Group type) it has some other columns, however, here we are interested only in these two columns. The demo output would be as, if the user selects IsApproverNeeded then only the Approver Name column will be displayed otherwise would be hidden. Now, lets get started with the demo.

Show or hide columns in a list or library form
Show or hide columns in a list or library form
Show Hide Columns conditionally in SharePoint list form demo

We have the SharePoint Online list ready with sample data.

Show or hide columns in a list or library form
Show or hide columns in a list or library form
Show Hide Columns conditionally demo with the sample SharePoint list

Click on the Title column hyperlink to open the list view form.

Then, the list item will be opened in the list view form.

Click on the Edit Form (3) dropdown list as shown in step 3.

Click on the Edit columns link.

Show or hide columns in a list or library form
Show or hide columns in a list or library form
Edit columns in Online SharePoint modern list form

Click on the three dots next to the column name for which you want to apply the formula. Here we have selected ApproverName as we want to hide and show this column based on the other column values changes (IsApproverNeeded Yes/No).

Show or hide columns in a list or library form
Show or hide columns in a list or library form
Edit columns formula in modern SharePoint Online list

Click on the Edit conditional formula link.

Show or hide columns in a list or library form
Show or hide columns in a list or library form
Edit conditional formula in modern SharePoint Online list

Enter the below text in the edit conditional formula box:

=if([$IsApprovalNeeded]==true,'true','false')
Show or hide columns in a list or library form
Show or hide columns in a list or library form
Edit conditional formula for SharePoint field

Click on the Save button.

Explanation about the above formula: conditionally show or hide column

  • The above formula will return true if the IsApproverNeeded is selected as yes.
  • Then the field ApproverName will be visible only when the formula returns true.

Conditionally show or hide: what can be done using the conditional formula?

To determine whether this field is shown or hidden, specify a conditional formula based on the value of another field. Leave it blank to clear the condition.

Show and hide column conditionally in SharePoint Online list Demo:

Open the list item in edit mode.

We can notice that by default IsApprovalNeeded is unchecked, so we cannot see the Approver Name column it is hidden.

Show or hide columns in a list or library form
Show or hide columns in a list or library form
Open SharePoint list form in edit mode to show and hide the column

Now, click on the IsApprovalNeeded checkbox, then we can see that the Approver Name column is being shown, and if we uncheck this selection

Show or hide columns in a list or library form
Show or hide columns in a list or library form
Show and hide the column in SharePoint list form conditionally demo

Note:

  • If your SharePoint list column is a required one (Require that this column contains information:), this show and hide formula cannot be applied, as today this is the limitation from Microsoft.

Lets check out the above limitation practically.

Make the ApproverName column as Require that this column contains information and click on the OK button.

Show or hide columns in a list or library form
Show or hide columns in a list or library form
Make existing column as required in SharePoint Online

Edit conditional formula in modern SharePoint Online list is hidden when the column is required:

Now, go again to the edit columns in the form configuration, and select the ApproverName column, we can notice that the Edit conditional formula is hidden now, only we can see the Move up option because we have made this column as a required.

Show or hide columns in a list or library form
Show or hide columns in a list or library form
Edit conditional formula in modern SharePoint Online list is hidden when the column is required

Working with various types of columns in SharePoint Online list for conditional formulas:

Type of the ColumnFormula Example
Number=if([$Cost]>2000,true,false)
Choice=if([$Department]==HR,true, false)
Date=if([$ProjectStartDate]==Date(17/03/2021),true,false)
Person=if([$ApproverFieldInternalName].email==,true,false)
Yes/No (check box)=if([$IsApproverNeeded]==true,true,false)

Note:

  • We can use @me for the currently logged-in user for the filter.

We even can add/subtract the value of fields before comparing, below is the example:

=if([$Column1]+[$Column2]<3000,'true','false')

Logical operators in the conditional formula in SharePoint Online list

Logical operators are also allowed inside the conditional formula in SharePoint online list.

Logical OperatorDescription
&&Logical AND operator
||Logical OR Operator
!Logical NOT Operator

Limitation column types not supported in conditional formulas in SharePoint list/library:

As of today, below list of columns is not supported in the conditional formula in the SharePoint list.

  • Choice with multiple selections
  • Time calculations in the Date and Time column
  • Currency columns
  • Location columns
  • Calculated columns
  • Person or Group with multiple selections

Summary: What we had here?

Thus, in this article we have learned the below with respect to show and hide column conditionally in SharePoint Online list form:

  • How to conditionally show and hide the column in SharePoint Online list form?
  • How to conditionally show or hide columns conditionally in SharePoint list or library form?
  • What are the supporting columns for the conditional formula in the SharePoint Online list or library?
  • Unsupported column types in conditional formulas.
  • How to work with logical operators in a conditional formula of SharePoint Columns?
  • Conditional formula example with the allowed SharePoint column types (Single Line Text, Choice, Yes/No, People, Number, Date)

See Also:

You may also like the below SharePoint/PowerApps article:

  • How to send email from PowerApps button click?
  • How to open outlook from PowerApps step by step?
  • Show or hide columns conditionally in SharePoint list form
  • Create your first chatbot in PowerApps step by step
  • Cascading dropdown in PowerApps using SharePoint data
  • CRUD operations in PowerApps using SharePoint online list
  • CRUD Operation in PowerApps Using Excel OneDrive
  • Phone number and email validation in PowerApps
  • Connect to a SharePoint list in PowerApps step by step
  • Collection variable in PowerApps
  • Customize the list form using JSON in SharePoint Online step by step
  • Column header formatting in SharePoint list Quick Edit or Datasheet View
  • Learn HTML table formatting using Microsoft Power Automate step by step
  • How to create a Tile view in modern SharePoint online lists and configure it.
  • Create calendar view on any list or library in modern SharePoint Online
  • SharePoint spaces to be available by default in New menu SharePoint Online
  • Customize SharePoint List Forms Using PowerApps step by step Office 365
  • SharePoint Online: private vs public office 365 groups in SharePoint online site
  • Configure SharePoint search box in office 365 suite bar step by step
  • Office 365: SharePoint vs Microsoft Teams Understanding the Differences in o365
  • How to enable SharePoint Syntex in Microsoft 365 tenant?

Buy the premium version of SharePoint Online & Office 365 administration eBook from here:


Show or hide columns in a list or library form

Share this:

  • Tweet
  • More

Like this:

Like Loading...

Related

Tags: Conditional formula to show or hide columns, Conditionally show or hide columns in a SharePoint list, SharePoint conditionally hide form fields, SharePoint list conditional fields, SharePoint required field conditional, Show or hide columns conditionally in SharePoint list or library form, Show or hide columns in a list or library form, Unsupported column types in conditional formulas

Post navigation

Previous postCreate your own chatbot in PowerApps step by step
Next postUse PowerApps in outlook: Launch outlook from PowerApps

You must log in to post a comment.