Cloud Workflow
Raise an IssueJoin Community
  • Getting Started
    • Introduction
    • Integration Basics
    • Sign Up and Get a License
    • Features and Benefits
  • DBSync Platform
    • Core Components
    • System Requirements
    • AppCenter
      • Company and User Management
    • Development Studio
    • Security Features
  • iPaaS
    • Home
    • Apps
    • Extend
      • Functions
    • Administration
      • User & Role Management
    • Logs
    • Remote Agent
    • Published Templates
  • Create your Workflow
    • Project
    • Task
    • Flow Builder
      • Standard Functions
    • Actions
      • Flow
      • Variable
      • Transform and Write
      • SQL
      • Restructure
      • Query
      • Debug
      • ReST
      • Conditions
        • If (Condition)
        • For (Loop)
      • Storage
        • Dropbox
        • File
        • CSV
        • Google Drive
        • FTP
        • S3
      • Flow Management
        • Flow
        • Logs
        • Notification
        • Schedule
        • API
        • Webhook
        • Forms
    • Configuring DBSync Environment
  • Connectors
    • Amazon S3
    • Authorize.NET
    • ChannelAdvisor
    • Database
    • Dropbox
    • FTP
    • Google Drive
    • Google Sheets
    • HubSpot
    • JIRA Cloud
    • JIRA Service Management
    • Linnworks
      • Creating the DBsync Application on Linnworks Developer Instance
    • Mailchimp
    • Microsoft Dynamics 365 Business Central
    • Microsoft Dynamics 365 Finance and Operations (D365 F&O)
    • Microsoft Dynamics CRM Online
    • Microsoft Dynamics GP
    • Microsoft Dynamics NAV
    • monday.com
    • Narvar
    • NetSuite
      • NetSuite Connector Settings
    • OpenAPI
    • PointClickCare
    • QuickBooks Desktop
    • QuickBooks Online
    • Sage Intacct
    • Salesforce
    • ShipStation
    • Shopify
    • SkuVault
    • WooCommerce
  • Template Library
    • Salesforce to QuickBooks Online Order to Cash
    • Salesforce to QuickBooks Desktop Order to Cash
    • Salesforce to FTP Integration
    • QuickBooks Online to Salesforce Accounts Receivable
    • QuickBooks Desktop to Salesforce Accounts Receivable
    • QuickBooks Online to Business Central Integration
    • QuickBooks Online to ShipStation Orders
    • QuickBooks Desktop to Shipstation Orders
    • QuickBooks Desktop to monday.com Integration
    • QuickBooks Online to monday.com Integration
    • Shopify to QuickBooks Online
    • Shopify to QuickBooks Desktop
    • Linnworks Orders to QuickBooks Online
    • Linnworks Orders to QuickBooks Desktop
    • Linnworks to Salesforce Integration
    • Salesforce Litify and QuickBooks Online
    • Salesforce Litify and QuickBooks Desktop
    • HubSpot to QuickBooks Online Order to Cash
    • HubSpot to QuickBooks Desktop Order to Cash
    • SkuVault Orders to QuickBooks Desktop
    • SkuVault Orders to QuickBooks Online
    • SkuVault and Salesforce
    • ChannelAdvisor Orders and Salesforce
    • ChannelAdvisor and QuickBooks Online
    • ChannelAdvisor and QuickBooks Desktop
    • Shopify Orders to Dynamics365 CRM
    • Shopify Orders to Salesforce
    • ShipStation to Dynamics 365 CRM
    • ShipStation Orders to Salesforce
    • ShipStation to QuickBooks Online Orders
    • ShipStation to QuickBooks Desktop
    • Target Recruit to QuickBooks Online
    • Target Recruit to QuickBooks Desktop
    • QuickBooks Online to Database
    • QuickBooks Desktop to Database
  • Troubleshooting
    • Common Errors & Fixes
    • Adding Trusted IP Address in Salesforce
    • Installing QuickBooks Web Connector
    • QuickBooks to Salesforce Data Migration
    • Setting Password in QuickBooks Web Connector
    • Starting QuickBooks Web Connector
    • Update Salesforce Password & Security Token in DBSync
  • Additional Resources
    • Billing Information - Auto Renewal
  • Tutorials
    • Salesforce and QuickBooks
      • Account Hierarchy in Salesforce and QuickBooks
      • Account Owner Mapping
      • Resolving Email Fields Sync Issues in QuickBooks Online
      • Mulitple Price Levels in Salesforce QuickBooks Integration
      • Multicurrency in QuickBooks to Salesforce Integration
      • Multicurrency in Salesforce - QuickBooks Desktop Integration
      • Multicurrency in Salesforce QuickBooks Online Integration
      • Product Hierarchy in QuickBooks and Salesforce
      • QuickBooks Data Extraction Queries
      • QuickBooks File Backup and Recovery Process
      • QuickBoooks Reports to Salesforce Integration
      • Recurring Transactions to Accounting System
      • Retrieve Value from custom Field of QuickBooks Online
      • Salesforce Opportunity to QuickBooks - Disabling Jobs
      • Salesforce QuickBooks Custom Mappings
        • Use Case
      • Salesforce QuickBooks Integration with Multiple QuickBooks
      • Syncing Standard Group Line Items in QuickBooks Desktop
    • Using Date Function in DBSync Integration
    • Salesforce and Database
      • Database to Salesforce Integration
    • Database to Database
      • Database to Database Integration
Powered by GitBook
On this page
  1. Create your Workflow
  2. Actions

Restructure

Learn how to use the restructure action item in DBSync Cloud Workflow

At times, records must be grouped to construct a single message for an application adapter. This is often required when processing records that contain multiple sub-records.

A common use case is invoice processing. Some applications, such as QuickBooks, MS Dynamics (GP), or Intacct, require invoice requests to be submitted as a single request. However, users may have invoices stored as separate records in a database table or view.

Database queries and CSV file readers often present grouped records as flat responses, making it difficult to convert them into a structured XML format.

Example Data Representation:

Invoice Number

Date

PO

ID

Product Code

Quantity

Amount

Total

1

1/1/2011

123

1

ABC

10

100

200

1

1/1/2011

123

1

DEF

20

200

200

1

1/1/2011

123

1

GHI

30

300

200

2

2/1/2011

123

2

ABC

10

100

300

2

2/1/2011

123

2

DEF

10

100

300

In this example, there are two invoices. The first invoice (invoice_num = 1) has three line items, while the second invoice (invoice_num = 2) has two line items. The target application expects two records instead of five.

To achieve proper grouping, the Restructure property can be used. It processes the response from the reader and organizes it into the correct XML structure.

To configure the reader, set the restructure property as follows:

invoice_num, date, po, id, [product_code, prod_qty, prod_amt], total

Any values enclosed in square brackets ([and]) are treated as sub-items. The column preceding the brackets serves as the grouping key, meaning a change in this value triggers the creation of a new XML structure. In this case, the grouping column is "id."

The split operation creates a node on the element before the brackets, labelled as "list." The XML output will be structured as follows

<row>
  <invoice_num>value</invoice_num>
  <date>value</date>
  <po>value</po>
  <id id="">
    <list>
      <product_code>value</product_code>
      <prod_qty>value</prod_qty>
      <prod_amt>value</prod_amt>
    </list>
    <list>
      <product_code>value</product_code>
      <prod_qty>value</prod_qty>
      <prod_amt>value</prod_amt>
    </list>
  </id>
  <total>value</total>
</row>

Map the target loop structure to id/list along with the field mappings.

Batch Size Customization:

To enhance flexibility, the Restructure feature now supports batch size customization. Users can specify a batch size that determines how many grouped records are processed together. This feature is particularly useful when handling large datasets, as it improves efficiency and system performance.

To configure the batch size, set the batch_size parameter in the Restructure property:

Example:

batch_size=100

This configuration ensures that records are grouped and processed in batches of 100 before being sent to the target application.

Limitations:

  • Only one level of grouping is allowed (i.e., there can only be one [ and one ]).

  • The grouping column (e.g., id) should not be mapped to any field except for the loop field in the mapping.

PreviousSQLNextQuery

Last updated 2 months ago