You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/declarative-customization/list-form-conditional-show-hide.md
+17-7Lines changed: 17 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Show or hide columns in a list form
3
3
description: Customize which columns to show or hide using a conditional formula in the list form by constructing a simple formula that are equations performing conditional checks on values in a SharePoint list or library.
4
-
ms.date: 06/28/2022
4
+
ms.date: 10/30/2024
5
5
ms.localizationpriority: high
6
6
---
7
7
@@ -38,7 +38,7 @@ You can show or hide columns in a list form based on another column's value by s
38
38
To specify a conditional formula for a column, in the **Edit columns** pane:
39
39
40
40
1. Navigate to the desired column for which you want to set a conditional formula
41
-
1. Select the far righthand edge of the column name to display the options menu **(...)**
41
+
1. Select the far right-hand edge of the column name to display the options menu **(...)**
42
42
1. In the more options, select **Edit conditional formula**.
43
43
1. In the **Edit conditional formula** dialog:
44
44
- To determine whether this column is shown or hidden, specify a conditional formula based on the value of another column.
@@ -56,7 +56,7 @@ For example, the following formula checks if the value for the *Category* column
Returning _true_results in showing the column on the form while returning _false_ hides the column.
59
+
Returning _true_shows the column on the form while returning _false_ hides the column.
60
60
61
61
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]`.
62
62
@@ -66,7 +66,7 @@ While the formula supports many of the available column types, we do not current
66
66
67
67
- Person or Group with multiple selections
68
68
- Choice with multiple selections
69
-
- Time calculations in Date and Time column
69
+
- Time calculations in **Date and Time** column
70
70
- Currency columns
71
71
- Location columns
72
72
- Calculated columns
@@ -98,7 +98,7 @@ You can also do arithmetic calculations, such as adding the value of two columns
98
98
99
99
##### Date column
100
100
101
-
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:
101
+
The following formula checks if the date column `[$StartDate]`equals a specific date. To do so, it uses the *Date()* function to convert a given string into a date:
@@ -126,16 +126,26 @@ The following formula checks if an email of person column `[$Owner]` is equal to
126
126
127
127
##### Boolean (Yes/No) column
128
128
129
-
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.
129
+
The following formula checks if the Yes/No column `[$Promoted]`equals a Yes. To do so, it checks for the value _true_ which maps to _Yes_ for users.
130
130
131
131
```
132
132
=if([$Promoted] == true, 'true', 'false')
133
133
```
134
134
135
+
The following are also valid:
136
+
137
+
```
138
+
=if([$Promoted], 'true', 'false')
139
+
```
140
+
141
+
```
142
+
=[$Promoted]
143
+
```
144
+
135
145
##### Lookup column
136
146
137
147
> [!NOTE]
138
-
> When accessing lookup columns in column or view formatting, you have access to the lookup value and lookup id as separate values. In form formatting and conditional field expressions, both values are returned as a single line of text. For instance, a lookup column referencing an item with item ID 1 (in the source list) with a value of `Toronto` will have a value of `1;#Toronto` when used in form formatting or conditional field expressions.
148
+
> When accessing lookup columns in a column or view formatting, you can access the lookup value and lookup id as separate values. In form formatting and conditional field expressions, both values are returned as a single line of text. For instance, a lookup column referencing an item with item ID 1 (in the source list) with a value of `Toronto` will have a value of `1;#Toronto` when used in form formatting or conditional field expressions.
139
149
140
150
The following formula checks if the lookup column `[$City]` has a value equal to *Toronto*. To do so, it splits the lookup value result by the separator and checks against the value.
0 commit comments