In my previous article, we have seen how to create an app workflow in SharePoint hosted apps. Here, we will discuss how to add the SharePoint hosted app workflow to the host web list.
Steps to add workflow,
Follow the below steps for adding the workflow in the host web list.
Step 1 - Package the SharePoint app from Visual Studio.
Step 2 - After publishing the app, right click on the .app file and select 7-zip to open the archive, as shown below.
Note: Download the tool here.
Step 3 - Once it's opened, select the WorkflowManifeas.xml file and open it in notepad.
Step 4 - Then, copy the below code, paste it to the workflow manifest file, and save it.
- <SPIntegratedWorkflow xmlns="http://schemas.microsoft.com/sharepoint/2014/app/integratedworkflow">
- <IntegratedApp>true</IntegratedApp>
- </SPIntegratedWorkflow>
Step 5 - After clicking
Save, you will get the following pop up. Just click
OK.
Step 6 - Then, upload the app package in your App Catalog.
Step 7 - After uploading the file, install the app on your site.
Step 8 - Go to your SharePoint site and open the list where you need to add the workflow.
Step 9 - Then, select the
List tab from top ribbon.
Step 10 - On the ribbon, click on the
Workflow settings. Then, select the
Add a workflow, as shown below.
Step 11 - Now, click on your app workflow. It will navigate to
Add a workflow page.
Step 12 - Select the workflow template, as shown below, and then, provide the following details.
- Name
- Select Task List
- Select History List
- Select start Options
Step 13 - Click OK for adding the app workflow.
Your workflow will be started successfully when items are added/Modified.
Summary
In this article, we have explored how to add the SharePoint hosted app workflow to the host web list in SharePoint Online.