Forum Discussion
creating approver flow using MS flow in sharepoint online
rautchetan27 as you want to trigger the approval manually you can put a JSON-formatted button on the item in your list or library. For the button you'll need a single line of text column.
The JSON code in my example is:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "Request approval",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"355cfb96-ddc5-4911-956c-9705f7557ee5\"}"
},
"style": {
"background-color": "#468259",
"color": "white",
"visibility": "=if(([$Status] == 'Completed'),'hidden','visible')"
}
}
You'll need to change ID of the flow to your flow's ID. IN the flow the trigger is a SharePoint For a selected item. And you might not need the conditional visibility so could remove that line and the comma on the previous line.
When you click the button you'll see a panel on the right of the screen asking you (the first time) to confirm the connections and (every time) to run the flow. The flow will then trigger and do whatever approval actions you have put in the flow.
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
- rautchetan27Aug 06, 2020Brass Contributor
I am new in MS flow, PowerApps, can you help me where to find option to write that JSON Code,
where I need to click so I can get window to write JSON Code.
- RobElliottAug 06, 2020Silver Contributor
rautchetan27 click the column header then select Column settings, then click Format this column and in the panel that appears select Advanced mode and paste the JSON code there.
Rob
Los Gallardos
Microsoft Power Automate Community Super User