Integrations Series – Data Mapping

Welcome back to our integrations blog series!
In the last post, we tackled authentication and all the other steps needed to set up a connection between Productive and Xero.
Now, let’s talk about data mapping – why do we need it?
As you already know, every system stores data differently, and without proper mapping, it’s like trying to fit together puzzle pieces from different sets.
Come along as we dig into the significance of data mapping in ensuring a seamless integration!
What about data consistency?
All data from Productive must be correctly mapped in Xero when copying invoices. We utilize explicit data mapping to ensure this.
The integrations model is used to implement all the integrations available in Productive, and each of these integrations is specific, requiring the mapping of different data uniquely. For this reason, the integration model defines an options
attribute in JSON format, intended to store all data specific to a particular type of integration.
After successful authorization, the user explicitly selects integration settings (such as exporting invoice numbers or payment sync) and maps data (account code mappings) between systems.
Data such as taxes and currencies are retrieved from Xero and automatically stored in the integration options field. This information will be essential for the user in subsequent integration tasks, such as exporting invoices:
User interface – Integration settings
General settings:
When the customer is successfully connected, a modal with settings opens. Here, the customer decides how to export invoices to Xero from Productive and whether they want data synchronization between Xero and Productive. When creating a new invoice, invoice numbers are generated for the customer, e.g., Invoice – 1, which can be done through Productive or Xero. Similarly, a decision is made for the system that will generate the invoice PDF in its specific way, including the invoice number. Also, an initial status is set before creating any invoice related to one particular branch, which is sent as a reference field and internal note.

Map settings:
When setting up a Xero account, there is an option to map each service type. In other words, a specific Xero account is set for each type. The Xero account is equivalent to the Productive service type. Each line item on the invoice belongs to a specific service type. When copying an invoice to Xero, we want to know to which values we will map our values. This is the next step after configuring the general settings.

In this example, we can see what the object looks like for mapping options for the entire integration:
Let’s focus on the fieldOptions
and fieldOptionLabelMap
. With these properties, we define how we want to map service types and how we want to display them to the customer for selection. We obtain the list of Xero accounts from the integration model on the backend, and on the frontend, we map them using these getters:
To ensure the validity of the integration update form, a default Xero account MUST be selected. This is allowed if customers have multiple service types and want to map only some of them to specific Xero accounts. This also means the default selected Xero account will be used for other service types.

Conclusion
In conclusion, integrations are crucial in enhancing productivity and efficiency in tools like Productive. The post series highlights the significance of integrating with platforms like Xero, showcasing the OAuth 2.0 protocol for secure authentication and the meticulous data mapping process. This seamless integration not only simplifies tasks such as invoicing and payment synchronization but also ensures consistency and customization in transferring data between systems with distinct business logic.
In conclusion, integrations are crucial in enhancing productivity and efficiency in tools like Productive. The post series highlights the significance of integrating with platforms like Xero, showcasing the OAuth 2.0 protocol for secure authentication and the meticulous data mapping process. This seamless integration not only simplifies tasks such as invoicing and payment synchronization but also ensures consistency and customization in transferring data between systems with distinct business logic.