Forum Discussion
Cancel a leave request after it's been approved
- May 10, 2022
anonymous9376 you could have a view of the leave list showing just the logged-in employee's leave request. A JSON-formatted button could be next to each one which would trigger a separate flow to cancel the leave request and update the status column.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
One way would be for a user to edit this approved leave request entry in the SharePoint list and change a drop down from Approved to Cancelled. This would then start a Power Automate flow to perform the approval/notification/calculation logic for the process you required.
Happy SharePointing!!!
Thank you.
- RobElliottMay 10, 2022Silver Contributor
anonymous9376 that wouyld look like this:
And the JSON is (but would use your flow ID):
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "button", "txtContent": "Cancel Leave Request", "customRowAction": { "action": "executeFlow", "actionParams": "{\"id\": \"01f36bf6-d218-43b2-8c9c-f718b10f9fbf\"}" }, "style": { "background-color": "#c00000", "color": "white", "visibility": "=if([$Status] == 'Completed' || [$Status] == 'Cancelled','hidden','visible')" } }Rob
Los Gallardos
Microsoft Power Automate Community Super User- anonymous9376May 10, 2022Brass ContributorRobElliott Thank you so much for your help.
- RobElliottMay 10, 2022Silver Contributor
anonymous9376 you could have a view of the leave list showing just the logged-in employee's leave request. A JSON-formatted button could be next to each one which would trigger a separate flow to cancel the leave request and update the status column.
Rob
Los Gallardos
Microsoft Power Automate Community Super User- Warwick WardMay 10, 2022Bronze Contributor
Nice one RobElliott - Column formatting is so powerful now with all the functions and operations available