Forum Discussion
Discard Checkout functionality for Sharepoint List Item
Annamsoft Hi Anna,
I think it would be helpful to have a bit more detail to understand what exactly is failing. Is the workflow failing to run, or is the workflow running and producing an error? In either case this is most likely a permissions issue. Either your users do not have the required permissions to run the workflow, or the action in the workflow is failing because of the user not having the required permissions. Discard checkout requires a high level of permission on the document library so this very well could be the issue. If you users have the appropriate permissions to discard check-out, then there is no need to run a workflow for this they can just do this already in the UI. If they do not have the required permissions, then I would first advise evaluating whether you can fix this issue with configuration before looking to customise. If you need to carry out an action in a workflow that the user does not have permissions to do themselves, then you need to run your workflows with "App" permissions, because a SharePoint workflow runs in the context of the user who initiated it and therefore you cannot elevate permissions (except in legacy 2010 workflow which I don't advise using). This article https://docs.microsoft.com/en-us/sharepoint/dev/general-development/create-a-workflow-with-elevated-permissions-by-using-the-sharepoint-workflo describes the concept of how to elevate permissions of a workflow, if this indeed is the issue you are facing.
Thanks,
Tal