Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 30 additions & 29 deletions docs/declarative-customization/list-form-conditional-show-hide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ localization_priority: Priority

# 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 deleted it. To re-use the column, you can simply show it again in the 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:

Expand All @@ -23,11 +23,11 @@ To show or hide a column in a list or library form:
- Locate the **Properties** section.
- Click **Edit all**.

1. At the top of the form, select **Edit Form > Edit columns**.
1. In the **Edit columns** pane, check (to show) or uncheck (to hide) the box for the column or columns as needed.
1. At the top of the form, select **Edit form > Edit columns**.
1. 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 select the up or down arrow next to the column name as preferred.
> 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.

1. When you're finished, select **Save**.

Expand All @@ -48,25 +48,26 @@ To specify a conditional formula for a column, in the **Edit columns** pane:

### Get started with conditional formulas

Formulas are equations that perform conditional expressions 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.
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*.
For example, the following formula checks if the value for the *Category* column is *Product Management*:

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

Returning _true_ results in hiding the column in the form while returning _false_ does not.
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].
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]`.

#### Supported column types in conditional show or hide
#### 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 columns with multiple selections
* Multiple choice column
* Time calculations in DateTime column
* 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
Expand All @@ -76,59 +77,59 @@ While the formula supports many of the available column types, we do not current

##### Choice column

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

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

##### Number column

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

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

You can also do arithmetic calculations, such as adding the value of two columns and checking its sum as follows in the following formula:
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')
=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:
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')
=if([$StartDate] == Date('4/6/2020'), 'true', 'false')
```

An example checking if the date column [$StartDate] is less than a specific date:
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')
=if([$StartDate] <= Date('4/6/2020'), 'true', 'false')
```

An example checking if the dates from [$StartDate] and [$EndDate] columns are between specific dates:
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')
=if([$StartDate] >= Date('4/6/2020') && [$EndDate] <= Date('6/10/2020'), 'true', 'false')
```

##### Person column

The following formula checks if the person column [$Owner] is equal to a specific user's email.
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')
=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.
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')
=if([$Promoted] == true, 'true', 'false')
```