Skip to content

Commit d76603b

Browse files
committed
Update to Approval Status column
1 parent 840ead2 commit d76603b

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

docs/declarative-customization/formatting-syntax-reference.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,16 +923,44 @@ The Approval Status field object has the following property (with example value)
923923
```JSON
924924
{
925925
"displayValue": "Approved",
926+
"numeric": 0
926927
}
927928
```
928929
`displayValue` is localized string of the approval status.
929930

930-
`@currentField` or `[$__ModerationStatus]` will resolve to the internal code -
931+
`@currentField` or `[$__ModerationStatus]`will also internally map to the following internal numeric value -
932+
```
931933
- 0 : Approved
932934
- 1 : Denied
933935
- 2 : Pending
934936
- 3 : Draft
935937
- 4 : Scheduled
938+
```
939+
`[$_ModerationStatus]` field supports comparisions to both strings as well as the numeric value. The numeric comparisions work across locales and languages, and that will be the recommended way for this field.
940+
941+
The following expressions evaluate to the output on the right, for when the status is `Pending`:
942+
943+
```JS
944+
// reading field value
945+
"[$_ModerationStatus]" => "Pending"
946+
947+
// obtaining the internal numeric value:
948+
"=Number([$_ModerationStatus])" => 2
949+
"=[$_ModerationStatus.numeric]" => 2
950+
951+
// addition results in string concatenation:
952+
"='status:'+[$_ModerationStatus]" => 'status:Pending'
953+
954+
// numeric comparisions
955+
"=([$_ModerationStatus] == 2)" => true
956+
"=([$_ModerationStatus] != 1)" => true
957+
958+
// other comparators are rarely useful, for cases where you want might want to exclude Draft & Scheduled
959+
"=([$_ModerationStatus] < 3)" => true
960+
961+
// localized string comparision, works only with one locale (en-us here)
962+
"=if([$_ModerationStatus]=='Pending','This Works too!', 'Nope!')" => 'This Works too!'
963+
```
936964

937965
The following example shows how a approval status field might be used on a current field.
938966

0 commit comments

Comments
 (0)