Skip to content

Commit 62be39f

Browse files
Merge pull request SharePoint#7494 from shagra-ms/shagra/support-approval-status
Support approval status
2 parents 62e474c + 25ba529 commit 62be39f

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

docs/declarative-customization/column-formatting.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Use column formatting to customize SharePoint
33
description: Customize how fields in SharePoint lists and libraries are displayed by constructing a JSON object that describes the elements that are displayed when a field is included in a list view, and the styles to be applied to those elements.
4-
ms.date: 10/18/2021
4+
ms.date: 11/11/2021
55
ms.localizationpriority: high
66
---
77

@@ -705,6 +705,7 @@ The following column types support column formatting:
705705
* Managed Metadata
706706
* Average Rating
707707
* Likes
708+
* Approval Status
708709

709710
The following are currently **not** supported:
710711

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

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Formatting syntax reference
33
description: Formatting syntax reference
4-
ms.date: 10/18/2021
4+
ms.date: 11/11/2021
55
ms.localizationpriority: high
66
---
77

@@ -863,6 +863,35 @@ The following example shows how an image field can be used on a current field.
863863
}
864864
```
865865

866+
**Approval Status fields**
867+
868+
The Approval Status field object has the following property (with example value):
869+
870+
```JSON
871+
{
872+
"displayValue": "Approved",
873+
}
874+
```
875+
`displayValue` is localized string of the approval status.
876+
877+
`@currentField` or `[$__ModerationStatus]` will resolve to the internal code -
878+
- 0 : Approved
879+
- 1 : Denied
880+
- 2 : Pending
881+
- 3 : Draft
882+
- 4 : Scheduled
883+
884+
The following example shows how a approval status field might be used on a current field.
885+
886+
```JSON
887+
{
888+
"elmType": "div",
889+
"txtContent": "@currentField.displayValue",
890+
"style": {
891+
"color": "=if(@currentField == 2, 'red', '')"
892+
}
893+
}
894+
```
866895

867896
### "[$FieldName]"
868897

@@ -1003,6 +1032,7 @@ The following column types can use displayValue property to get the default rend
10031032
* Number
10041033
* Yes/No
10051034
* Currency
1035+
* Approval Status
10061036

10071037
```JSON
10081038
{

0 commit comments

Comments
 (0)