Fix "App Step" is Disabled in SharePoint Designer Workflow

Problem: "App Step" is grayed out in SharePoint Designer Workflow!
App Step disabled in SharePoint Designer Workflow

What is App Step in SharePoint?
SharePoint designer workflows get executed from the context of the user who initiated the trigger – started the workflow. E.g. If a workflow gets triggered on new item creation, it gets executed from the context of the user who created that item. However, at times, we may need to perform operations to which the current user may not have rights. App step in SharePoint designer workflow resolves this issue by running the workflow step from the context of "Workflow App" which has full rights on the site, so that the workflow can perform operations in elevated permission mode. E.g. Setting access rights can’t be performed by a user with contributor rights, isn’t it? When you place that step inside "App Step", it gets executed from Workflow App's context.

SharePoint Online: How to Enable App Step in SharePoint Designer?
In SharePoint 2010, we had "Impersonation Step" which is replaced with "App step" in SharePoint 2013 on-wards. App Step is not available by default you need to perform below steps in order to enable App Step in SharePoint designer workflows.

Step 1: Activate "Workflows can use app permissions" Site Feature
As a first step, The feature "Workflows can use app permissions" needs to be activated.
  • Go to Site Settings of the site in which you are creating workflow >> Click on "Manage Site Features" link under Site Actions group 
  • In Site Features page, Scroll to the bottom of the page and click on Activate button next to "Workflows can use app permissions" feature, if it’s not activated already.
    App Step grayed out in SharePoint Designer

Step 2: Grant Permission to Workflow App 
Once the feature is activated, the next step is to grant FULL Control permission to workflow app on the site. Follow these steps:

Get the Workflow App ID:
We need the workflow App ID to grant access to it:
  • Go to Site Settings >> Under "Users and Permissions" group click on "Site App Permissions" link
  • Locate the "Workflow" and copy the GUID between the | and the @ symbols. E.g. here in my case "705d3e7a-e387-4561-969e-bcp125f268829a" 
    get workflow app id

Grant Access to Workflow App
Once you obtained the workflow App ID, the next step is to grant access to it.
  • Navigate to the Grant Permission to an app page by browsing to the appinv.aspx page of the site. Example: http://yourtenant.sharepoint.com/SiteCollection/_layouts/15/appinv.aspx
  • Enter the Workflow APP ID copied in the previous step >> Click on "Lookup" button. SharePoint fills other fields except "Permission Request XML"
  • Paste the below XML in Permission request and click on “Create” button to grant permission to the Workflow App.
  • <AppPermissionRequests AllowAppOnlyPolicy="true">
     <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
    </AppPermissionRequests>
    grant access to workflow app
  • Click on "Trust It" to complete granting access to the Workflow App ID.
    sharepoint  workflow  app
Restart SharePoint Designer. Create or edit any SharePoint 2013 Workflow and the App Step should be enabled!

enable app step in sharepoint designer

MSDN Reference: https://docs.microsoft.com/en-us/sharepoint/dev/general-development/create-a-workflow-with-elevated-permissions-by-using-the-sharepoint-workflo?redirectedfrom=MSDN

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.