How to hide Microsoft Lists columns in forms conditionally

Microsoft Lists allows you to format the forms using JSON and also allows you to show/hide columns conditionally based on the data that is stored in the item.

In this article you will learn how the conditional formulas work and how you can add them to the to list columns individually.

Conditionally display columns in Microsoft Lists

If you are familiar with Excel you should know that conditional formulas use the same syntax used by spreadsheets, if you are not familiar with it you can check the example and explanation below.

=if([$Extra_x0020_Bags]==0,'true', 'false')

A conditional formula starts with an equal signal followed by a condition and by the attributes true and false, which define the visibility for the column depending on the outcome of the condition. The condition must reference a column by its internal name, and a column being formatted can reference the column itself or any other column.

To apply conditional formatting to the form columns, you must do the following:

  1. Open the new item form or an item detail form and at the top of the form click in the edit form icon as illustrated in the following picture
  2. From the menu click on Edit columns
    Conditionally display columns in Microsoft Lists
  3. Click on the vertical … to open the column context menu
  4. Click on Edit conditional formula
    Conditionally display columns in Microsoft Lists
  5. In the pop-up window, type your formula
    Conditionally display columns in Microsoft Lists
  6. Click on Save to apply the formula

A column formatted conditionally will be displayed disabled in the form list of columns as its visibility depends on the data.

In the example illustrated in this article, the column Extra Bags is only shown in the item detail form if the value if greater than 0, in the following animation you can see how it behaves with the condition is true and false.

Conditionally display columns in Microsoft Lists

Using this feature, you will not be showing data that despite being stored in the list is not relevant for an end user consulting information.

No comments yet

Leave a Reply

I've been working with Microsoft Technologies over the last ten years, mainly focused on creating collaboration and productivity solutions that drive the adoption of Microsoft Modern Workplace.