Skip to content

Commit 0458943

Browse files
ldemarisVesaJuvonen
authored andcommitted
Update column-formatting.md (SharePoint#1261)
add sample for Flow button
1 parent 2853c5f commit 0458943

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

docs/declarative-customization/column-formatting.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,46 @@ This example relies on two number fields, `Before` and `After`, for which the va
593593
]
594594
}
595595
```
596+
## Create Flow Buttons
597+
You can use column formatting to create buttons that, when clicked, run Flows on the corresponding list item. If the Flow is configured to gather data from the end user before running, the Flow Launch Panel will be displayed after clicking the button. Otherwise, the Flow will just run.
598+
599+
To use the sample below, you must substitute the ID of the Flow you want to run. This ID is contained within the `customRowAction` attribute inside the `button` element. To obtain a Flow's ID:
600+
601+
1. Click Flow > See your flows in the SharePoint list where the Flow is configured.
602+
2. Click on the Flow you want to run
603+
3. Copy the ID from the end of the URL.
604+
605+
```
606+
{
607+
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
608+
"elmType": "span",
609+
"style": {
610+
"color": "#0078d7"
611+
},
612+
"children": [
613+
{
614+
"elmType": "span",
615+
"attributes": {
616+
"iconName": "Flow"
617+
}
618+
},
619+
{
620+
"elmType": "button",
621+
"style": {
622+
"border": "none",
623+
"background-color": "transparent",
624+
"color": "#0078d7",
625+
"cursor": "pointer"
626+
},
627+
"txtContent": "Send to Manager",
628+
"customRowAction": {
629+
"action": "executeFlow",
630+
"actionParams": "{\"id\": \"183bedd4-6f2b-4264-855c-9dc7617b4dbe\"}"
631+
}
632+
}
633+
]
634+
}
635+
```
596636

597637
## Supported Column Types
598638
The following column types support column formatting:
@@ -667,6 +707,7 @@ Specifies the type of element to create. Valid elements include:
667707
- img
668708
- svg
669709
- path
710+
- button
670711

671712
Any other value will result in an error.
672713

0 commit comments

Comments
 (0)