# Transform and Write

## Introduction

DBSync Cloud Workflow Transform and Write Action is used to read data from the source application, transform it, and write it in the target application.

Through this action, you can transform data by changing formats or applying calculations before it gets sent to the target application.

## Use Case

In this tutorial, we will demonstrate how to use the Transform and Write action to pull Salesforce Accounts and insert them as Customers in QuickBooks.

## **Prerequisites**

Before you begin, ensure you have the following:

* A sample flow, query, and debug setup. Refer to the Query documentation for more information on query creation.
* The Salesforce application connector is configured.
* The QuickBooks application connector is configured.

#### **Confiigure Transform and Write Action**

1. In the Flow screen, drag the Flow **Action** from the Actions palette on the left and drop to the center of the screen.
2. Click the **Configure** button on the flow panel to configure the flow. &#x20;
3. In the **Flow configuration** panel that opens on the right side, enter the required description for the flow and click **Save**.
4. Add a **Query** Action: Now drag and drop the **Query** action into your workflow.

   <figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FfKn0L458zfdFt1xx2J1u%2Funknown.jpeg?alt=media&#x26;token=703ecf3d-ec07-408d-a1a5-e9ed1cfbd49f" alt=""><figcaption></figcaption></figure>
5. Click **Configure** and set the source to Salesforce and the object to Account. You can choose **All Fields** or specific fields as required.
6. **Preview Query Results**: Click **Preview** to display the results of the query. Ensure that the query returns the expected data and then click **Save**.
7. A**dd Transform and Write Action:** Drag and drop the **Transform and Write** action into your workflow.
8. Click **Configure** and select the operation as *Insert*, the target as QuickBooks and the object as Customer.
9. Mapping Fields: Click Map and define how data fields from the source system are transformed and transferred to corresponding fields in the target system during integration.
10. Drag and drop the necessary fields from the Salesforce Account object to the corresponding QuickBooks Customer fields. For example, map the Display Name field in QuickBooks with the Name field from Salesforce.
11. **Save the Mapping**: After completing the mapping, click Save to save the mapping configuration and close.
12. **Save the Transform and Write Action Workflow**: Click **Save** to save the Transform and Write action.

    <figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FxgwePZXxY3HWPg7VzAHB%2Funknown.jpeg?alt=media&#x26;token=678c28d4-6476-49d1-bd3f-eb8e0ae3d3f7" alt=""><figcaption></figcaption></figure>
13. **Run the Integration**: Click Run <img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FX6az4rYSjWoEQaWSq87x%2Funknown.png?alt=media&#x26;token=32ce71c3-0864-487e-8671-9817891caf93" alt="" data-size="line"> to execute the integration. The console will display the executed query, and it will insert the Salesforce Accounts as Customers in QuickBooks.
14. **Debugging**: If needed, add a **Debug** action before the **Transform and Write** action to verify the data being processed. **Configure** the **Debug** action to display relevant fields to confirm that the data is correct before it is written to QuickBooks.
15. **Review Console Output**: After running the integration, check the console output for any errors or confirmation messages to ensure the process completed successfully.

![](https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FY1pd9Pvtm1GW8YUMlMPB%2Funknown.jpeg?alt=media\&token=1ef71d6e-fecf-4fcf-b3f8-6ff64c8ef43d)

16. **Iterate and Optimize**: Based on the results and any errors encountered, make necessary adjustments to the mapping or query as needed. Repeat the process until the workflow operates as expected.

> **PRO TIP:**
>
> When mapping fields in the 'Transform and Write' action, ensure that the data types between the source and target fields are compatible. This prevents data conversion issues and ensures smooth data transfer.

| <p><strong>1. Can I transform data before writing it to the target application?</strong></p><p>Yes, the 'Transform and Write' action allows you to transform data, such as changing formats or applying calculations, before writing it to the target application.</p><p></p><p><strong>2. Is it possible to use multiple queries in a single Transform and Write action?</strong></p><p>Yes, you can use multiple queries and combine their data in a single 'Transform and Write' action to write comprehensive data sets to the target application.</p><p></p><p><strong>3. How do I handle errors encountered during the Transform and Write process?</strong></p><p>Use the console output and debug actions to identify and troubleshoot errors. Check for issues like data type mismatches, missing fields, or incorrect mappings.</p><p></p><p><strong>4. Can I schedule the Transform and Write action to run automatically?</strong></p><p>Yes, DBSync Cloud Workflow allows you to schedule flows, including the Transform and Write actions, to run automatically at specified times.</p> |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### Related Content

[Query](https://docs.mydbsync.com/cloud-workflow/ipaas/functional-concepts/query): Creating and Managing Queries in DBSync Cloud Workflow

[Flow](https://docs.mydbsync.com/cloud-workflow/ipaas/functional-concepts/flow): Automating Workflows with Scheduled Tasks

[Logs](https://docs.mydbsync.com/cloud-workflow/dbsync-platform/administration/logs): Troubleshooting Common Errors in DBSync Integrations

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mydbsync.com/cloud-workflow/2026_create-your-workflow/action/transform-and-write.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
