Connecting SharePoint to Xero with Azure Logic Apps

Like many businesses with Office 365, we use SharePoint Online quite a bit for business intelligence, process automation and document/data storage.

We also use other cloud applications like Xero for cloud accounting. Though we were looking for a way to connect our separate cloud tools together to cut down on double handling of data and automate our invoicing.

We first tried to get the solution working entirely via a SharePoint workflow in SharePoint Designer. It wasn’t long before we gave up on this approach because we didn’t know how to do the initial authentication of the web service calls to Xero from SharePoint Designer.

The Xero Developer Center provides some good documentation and guides on configuring apps to connect to Xero organisations, so we decided to build a web API on Microsoft Azure in conjunction with a SharePoint workflow to pull this off.

Here’s what the solution looked like:SharePoint Workflow Idea

 

Advantages

  • All the OAuth authentication work is done by the API, and we can send all our calls with a client ID and Secret from SharePoint Designer with a web service call.
  • The API is designed to service multiple customers, so we can provide this as a service to our customers who want to connect SharePoint to Xero.

Disadvantages

  • We weren’t too fussed on the idea of storing the Xero Client ID and secret in SharePoint Designer, where it can be viewed by any user who can open workflows.
  • Configuring the solution for multiple customers would mean setting up and supporting these SharePoint Designer workflows across multiple organisations.

Ideally we would have a way to coordinate the flow of data between SharePoint and our API from a secure, centralised location – and, although we’re messing about with the Office 365 APIs, we’re not the most experienced developers.

Enter Azure Logic Apps

The solution to our problem came with the announcement of Azure Logic Apps back in March. This gave us the perfect way to orchestrate the authentication and flow of information between the services.

CreateAzureLogicApp

Our Azure Logic app monitors a designated SharePoint list for a new item (invoice), and once triggered, will initiate a HTTP call against our API with the relevant invoice information. We also added in a notification email step using the built-in Office 365 API app.

AzureLogicAppSteps

 

Here’s how our invoicing process works now:

  1. Remote support technicians complete a job.
  2. If the customer is not on a support contract, a SharePoint workflow creates a new item in a separate SharePoint list for processing with all the information required for invoicing.
  3. The Azure Logic App checks the list every minute, and when it finds a new item, pulls the information and populates a HTTP POST call in the format required by Xero. This creates a draft invoice in Xero, where it can be approved later.
  4. After an invoice is created successfully, a notification email is sent to let us know there’s an invoice awaiting approval.

AzureLogicAppFlow

 

Advantages

  • Since it’s running in Azure, we can set this solution up for other customers, and manage everything from the Azure Portal.
  • The Xero Client ID and Secret is stored in a central, secure location.
  • Azure Logic Apps provide detailed reporting on the success/failure of previous runs. This was extremely helpful during the initial setup.
  • No double handling of data between clouds and no missed invoices!

Azure Logic App History

Invoices processed by the Azure Logic App:

Invoices Processed by the Azure Logic App

Here’s a draft invoice created in Xero by the Logic App and our custom API. We’ve also set it up to work with our custom tracking fields, so that the technician who completed the job in SharePoint is recognised in Xero.

Invoice Created in Xero using SharePoint List Data

Invoice created in Xero using SharePoint list data

 

More reasons to connect SharePoint to Xero with Azure Logic Apps

The invoice creation workflow is the first that we’ve setup using our custom API, though there are other possible use cases for this service. For example:

  • Pull overdue invoices from Xero, assign task to SharePoint users to follow up
  • Get list of contacts from Xero in a SharePoint List
  • Add New contacts to Xero from SharePoint List
  • Use Excel services to create business intelligence dashboards, extending the functionality of Xero reporting

Have some other ideas? Get in touch!

 

 

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *