Show or hide columns in a list or library form

You can show or hide columns in a list or library form as an alternative to deleting them. When you hide a column, it doesn't affect the column or the data in the column, as it would if you delete it. To re-use the column, you can simply show it again in the form.

To show or hide a column in a list or library form:

  1. Go to the list or library for which you want to show or hide columns in the form.

  2. If you are in a list:

    • Open an item to view the item details in the display form.
  3. If you are in a document library:

    • Select a file.
    • In the Information Pane:
      • Locate the Properties section.
      • Click Edit all.
  4. At the top of the form, select Edit form > Edit columns.

  5. In the Edit columns pane, check (to show) or uncheck (to hide) the checkbox for the column or columns as needed.

    Note

    If you want to re-arrange the order of the columns, either drag-and-drop the column name, or first select the far right hand edge of the column name to display the options menu (...) and then select Move Up or Move Down as preferred.

  6. When you're finished, select Save.

Specify conditional formula to show or hide columns

You can show or hide columns in a list form based on another column's value by specifying a formula that are equations performing conditional checks on values in a SharePoint list or library.

To specify a conditional formula for a column, in the Edit columns pane:

  1. Navigate to the desired column for which you want to set a conditional formula

  2. Select the far right hand edge of the column name to display the options menu (...)

  3. In the more options, select Edit conditional formula.

  4. In the Edit conditional formula dialog:

    • To determine whether this column is shown or hidden, specify a conditional formula based on the value of another column.
    • To clear the condition, leave it blank.
  5. When you are finished, select Save.

Get started with conditional formulas

Formulas are equations that perform conditional checks on column values in a list or library. A formula starts with an equal sign (=) followed by the if function that returns either a true or a false result.

For example, the following formula checks if the value for the Category column is Product Management:

=if([$Category] == 'Product Management', 'true', 'false')

Returning true results in showing the column on the form while returning false hides the column.

The column is represented by specifying the internal name of the field surrounded by square brackets and preceded by a dollar sign: [$InternalName]. For example, to get the value of a field with an internal name of "ProductName", use [$ProductName].

Unsupported column types in conditional formulas

While the formula supports many of the available column types, we do not currently support the following column types:

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

Quick formula reference

Choice column

The following formula checks if the choice column [$Category] has a value Product Management:

=if([$Category] == 'Product Management', 'true', 'false')
Number column

The following formula checks if the number column [$Flightscost] is less than or equal to 120:

=if([$Flightscost] <= 120, 'true', 'false')

You can also do arithmetic calculations, such as adding the value of two columns and checking its sum as given in the following formula:

=if(([$Flightscost] + [$Hotelcost]) > 500, 'true', 'false')
Date column

The following formula checks if the date column [$StartDate] is equal to a specific date. To do so, it uses the Date() function to convert a given string into a date:

=if([$StartDate] == Date('4/6/2020'), 'true', 'false')

An example of checking if the date column [$StartDate] is less than or equal to a specific date:

=if([$StartDate] <= Date('4/6/2020'), 'true', 'false')

An example of checking if the dates from [$StartDate] and [$EndDate] columns are between specific dates:

=if([$StartDate] >= Date('4/6/2020') && [$EndDate] <= Date('6/10/2020'), 'true', 'false')
Person column

The following formula checks if an email of person column [$Owner] is equal to a specific user's email:

=if([$Owner.email] == 'nestorw@contoso.com', 'true', 'false')
Boolean (Yes/No) column

The following formula checks if the Yes/No column [$Promoted] is equal to a Yes. To do so, it checks for the value true which maps to Yes for users.

=if([$Promoted] == true, 'true', 'false')
Lookup column

The following formula checks if the lookup column [$City] is equal to Toronto. To do so, it checks for the value 1;#Toronto where 1 is an item ID in the lookup list of cities.

=if([$City]=='1;#Toronto', 'true', 'false')