Form Connector – Xero

Form Connector – Xero

Premium Feature

This feature requires a Premium user license to access.

Our platform lets you easily add and quickly configure a one-way synchronization of form-captured data to Xero.

After adding and authenticating a Xero ConnectionXero Form Connectors can be added to Data Entry Forms to push data when a form is uploaded, which is what this article is about.

Adding the Connector

Follow these steps to add the connector to your specific form:

  1. Navigate to App Workshop > Forms.
  2. Hover over your desired form and click the Connect icon.
  3. Click the Add Connector button (top-right).
  4. Select Xero from the options.

Note: The page will refresh with the connector added. Changes are not live until you click Save.

Quick Access Tip

If you are already inside the Form Builder or Settings view, you don’t need to go back to the main menu. Simply click the Connectors tab located directly under the form title at the top of the screen.

Configuring the Connector

Once the Connector is added, you can select what you want to create or update in Xero.

Specify an operation, such as accounting or payroll, and then, more specifically, endpoints, such as contacts, invoices, tracking categories, and timesheets within these areas, where form-captured data will be pushed.

After selecting an operation and endpoint, respective properties become available that can be dynamically driven from field-captured data by referencing field datanames or using a formula.

Depending on the operation and endpoint selected, some properties might require identifiers (IDs) from your Xero account to push data successfully when updating or creating. 

The following table contains links to Xero documentation to help you identify ID values. However, obtaining these ID values might be tricky, depending on which ones you need.

Obtaining Xero IDs

Please view Obtaining Xero IDs for more information.

OperationEndpointPropertyXero Docs
AccountingContactsContact IDAccounting API Contacts
AccountingInvoicesInvoice Type
Invoice ID
Line Items
Accounting API Types and Codes
Accounting API Invoices
Accounting API Invoices
AccountingTracking CategoriesTracking Category IDAccounting API Tracking Categories
AccountingAccountsAccount IDAccounting API Accounts
AccountingItemsItem IDAccounting API Items
Payroll AUTimesheetTimesheet IDPayroll AU API Employees
Payroll AUEmployeeEmployee IDPayroll AU API
Payroll UKTimesheetCalendar ID
Timesheet ID
Payroll UK API Pay Run Calendars
Payroll UK API Timesheets
Payroll UKEmployeeEmployee IDPayroll UK API Employees

However, if a property you’re looking for isn’t initially available, select the Optional Fields text box, which provides a list of additional fields that can be added for further configuration.

Furthermore, add a Run Condition if you only need this connector to trigger due to a specific condition based on form-captured data. When a formula entered returns a true result on upload, it will trigger the Connector instead of every upload.

Once you’re done configuring, hit Save at the top right. This will enable the Connector to push data to your Xero account when forms are submitted.

Creating vs Updating Xero Data

Certain properties are required when you’re updating or creating new data in Xero with the form connector.

For example, a contact name will be required if you’re creating a new contact, as opposed to a contact name and ID for updating.

PropertyCreatingUpdating
Accounting > ContactsNameName
Contact ID
Accounting > InvoicesType
Contact ID
Contact Name
Line Item – Description
Type
Invoice ID
Contact ID
Contact Name
Line Item – Description
Accounting > Tracking CategoryNameName
Tracking Category ID
Accounting > AccountsCode
Name
Type
Account ID
Accounting > ItemsCodeCode
Payroll AU > Timesheet
Employee ID
Start Date
End Date
Timesheet ID
Employee ID
Start Date
End Date
Payroll AU > EmployeeEmployee IDEmployee ID
Payroll UK > TimesheetPayroll Calendar ID
Employee ID
Start Date
End Date
Payroll Calendar ID
Employee ID
Timesheet ID
Start Date
End Date
Payroll UK > EmployeeEmployee IDEmployee ID

Obtaining Xero IDs

There are three options available. Options one and two work to obtain most ID values, whereas option three can acquire them all.

Note that with option two, if your operation is Accounting and you need a Contact ID, Invoice ID, or Tracking Category ID, you should be able to get them from the URL.

Use Xero – Data Source Connectors to pull data into the platform from Xero for use on screens and their connector properties.

Option Two

Navigate your Xero account and obtain an ID from the URL when viewing a contact, invoice, tracking category, or employee.

For example, an Employee ID is obtained from the URL when viewing the Employee’s details in Xero.

Option Three (advanced)

Use a Xero Developer account’s API Explorer feature to GET endpoint data and obtain an ID from a response from your connected organization’s Xero account.

The exact details you use to log into your Xero organizational account can be used to log into your Xero Developer account.

For example, a request to get employee data.

The response with employee IDs.

Managing Repeatable Data

Some endpoints will require you to submit repeatable data in fields that might appear to be for single instances of data. This is best seen on the Payroll endpoints for instance, where you will need to enter values for say, Monday, but the timesheet may cover multiple weeks, so you will have more than one Monday for that particular timesheet payroll period.

Below is a list of all the endpoints that can handle repeatable values ie, values that are either from within a table or on a repeatable page:

Accounting API –Contacts
    Addresses
    Phones
    Contact Persons
    SalesTrackingCategories
    PurchasesTrackingCategories

Accounting API –Invoices
    LineItems

Payroll AU -> Timesheets
    TimesheetLines
        NumberOfUnits (Inside TimesheetLines and also repeatable)

Payroll UK/NZ -> Timesheets
    TimesheetLines

In this section, we’ll examine the use of repeatable data in two endpoints: the Payroll AU and Payroll NZ endpoints.

Start and End Dates for Pay Periods

The StartDate and EndDate used in the Payroll endpoints should ALWAYS match the pay period defined in Xero. If either the start date or the end date don’t match with Xero, the form connector will give an error.

Payroll AU

The Timesheet Line can have one or multiple entries. If multiple entries need to be submitted, it is better to put them inside a table (repeatable) and map the fields, e.g., Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday.

This would allow for scenarios where a pay period is set to fortnightly and the user will need to enter 2 rows for the pay period, to cater for the 2 weeks in the fortnight period.

The image below shows what a form would look like to cater for a multi-week pay period:

Below is a screenshot of how you map those day fields from the table (shown above) to the connector, allowing the connector to iterate through your rows as required by the pay period specified.

Payroll NZ/UK

This endpoint abides by the same structural conditions as the Payroll AU endpoint, i.e., the start date and End Date need to be the same period as specified in Xero, and the Timesheet Line can have one or multiple entries. When multiple entries need to be submitted, it is best to put these fields inside a table and map the fields in the form to the connector fields.

This endpoint requires two additional parameters to be included, though, and these are:

  • Number of Units – this is the number of hours worked on a particular date.
  • Date – is the specific date when the work took place.

    • Related Articles

    • Form Connector – Xero Files

      Our platform lets you easily add and quickly configure a one-way synchronization with Xero Files. After adding and authenticating a Xero Connection, Xero Files Form Connectors can be added to Data Entry Forms to push files containing form-captured ...
    • Connecting to Xero

      What is Xero? Xero is a cloud-based accounting software designed for small to medium-sized businesses. Offering a range of features to streamline financial processes. These processes can be further streamlined with apps from our platform that can ...
    • Data Source Connector – Xero

      Premium Feature This feature requires a Premium user license to access. Our platform lets you easily add and quickly configure a one-way synchronization with Xero data for use in the screens you create. After adding and authenticating a Xero ...
    • Xero Item Endpoints – Using Google App Script

      This article provides detailed instructions on using Google Apps Script to retrieve line-item product and service information from your Xero account. Google Apps Script is a cloud-based JavaScript platform powered by Google that lets you integrate ...
    • Form Connector – ArcGIS

      After adding and authenticating an ArcGIS Connection, you can easily send form entry data to the ArcGIS API by configuring the ArcGIS form connector, as shown in this article. Adding the Connector Follow these steps to add the connector to your ...