/
Use OneList to sign off a SharePoint document

Use OneList to sign off a SharePoint document

This example shows how to implement a simple document sign-off process using OneList.

The process starts from user uploads a document to a SharePoint document library with the document’s sign-off status setting to “Pending”. This triggers the “Task Sync” logic app to compose the messages for the SyncTasks and the SyncAttachments APIs. It also ensures the user mapping is created for the document approver’s SharePoint account. The messages are placed in the Outbound message queue and posted to OneList APIs by the “Post To OneList” logic app. OneList creates the approval task ready for the approver to take action. The approver reviews and approves the task on OneList. The ”Get From OneList” logic app picks up the task action request from OneList and places it in the Inbound queue. The “Task Action” logic app processes the task action request and calls SharePoint API to updated the documents sign-off status to “Approved”. The sign-off process is complete and the document is approved.

Create the SharePoint document library

Create the document library and add the following columns to the library:

  • Sign-off status - a Text field with “Pending” as the default value;

  • Approver - a Person field;

Register the document approval task adapter in OneList

  • Create the SharePoint system and generate a new API key for the system;

  • Create the SharePoint document approval task category;

  • Create the task adapter and specify the “document_sign_off” as the task type;

Implement the integration processes in Azure Integration Services

It is recommended to create a Azure Resource Group for all the objects created for the integration:

  • The Azure Service Bus namespace;

  • The Logic App Customer Connector for OneList;

  • The Logic Apps;

  • The API connections used by the Logic Apps;

The Azure Service Bus namespace

Create an Azure Service Bus namespace for OneList. The namespace can be shared by multiple OneList integration processes to different source systems. Inbound and Outbound queues are created in the namespace. Each source system should have its own inbound and outbound queues, so name your queues carefully to avoid confusion;

The OneList connector

Follow the instructions in How to create OneList connector for Azure Logic App to create the OneList connector.

The Task Sync logic app

This Azure Logic App implements the delta task sync process for new and changed documents in the library:

  1. The trigger of this logic app is the SharePoint trigger => When a file is created or modified (properties only) which monitors changes in the document library. If you need to monitor changes in a SharePoint list, use the SharePoint trigger => When an item is created or modified instead;

  2. The “Initialize user profiles variable” is a Variables => Initialize Variable action for the array variable used in the Compose SyncUsersRequests step to build the request list;

  3. The “Switch” is a Control => Switch action which implements the branching logic based on the document’s Sign-off status;

The Post To OneList logic app

This Azure Logic App posts the messages in the outbound queue to the corresponding OneList API.

The Get From OneList logic app

This Azure Logic App polls OneList periodically to get the task action requests.

  • The trigger is a Schedule => Recurrence action which the interval and frequency of the polling are specified;

  • The “api-datasync-gettaskactionrequest” is an OneList Connector => Get Task Action Requests action;

  • The Control => For each action loops through the task action requests and place each request message in the inbound message queue;

The Task Action logic app

This Azure Logic App gets the OneList task action request and updates the SharePoint document’s Sign-off status field;