Skip to content Skip to sidebar Skip to footer

How to Bulk Upload Salesorder With Line Items in Netsuite

# Using Lists (AKA arrays)

App integrations often piece of work with lists, for instance, syncing sales invoices involves moving of line items, syncing customer accounts involves moving of associated leads and contacts, etc.

Workato is able to read from and write to lists in various ways.

Automation Constitute

Learn how to use listing datapills with the hands-on workshop on the Automation Found. Complete the class and become a certified Automation Pro. Find out more here (opens new window)

# Example list setup

Various examples will be provided in this commodity on list direction. The following sample CSV file volition be used every bit the case listing.

In about of the examples, the Box trigger New CSV file will exist used to read this CSV file from a Box binder and parse it to Workato as a listing of three CSV lines. Create a CSV file with the above CSV sample and upload into a specific Box folder for the New CSV file trigger to pick upwards.

If the above CSV file is the only CSV file in the selected Box folder in the trigger configuration, the fields list will be populated automatically with the cavalcade names. The column names take to represent exactly with the header line in the CSV file in order for the CSV data to be mapped accurately to their columns.

Defining expected CSV columns Defining the expected columns in the CSV files that the recipe will pick up. Case recipe (opens new window)

The columns defined in the Box new CSV file trigger shows upwardly as a list of usable variables in the output datatree. These variables can be used to map into subsequent recipe steps.

Notice the Lines icon in the datatree. This identifies lists in the datatree.

List datatree icon List icon within datatree

These datapills can be used to map into Workato actions' input fields. There are three means to map datapills from lists:

  • directly into an action without list processing
  • into an activity with a listing input (action handles list processing implicitly)
  • into an action with a Repeat pace (action does not handle list processing, list processing needs to be done explicitly at the recipe logic level)

# Using datapills from lists

# Using datapills directly in an action without list processing

When using pills direct from a list, only the values of the first listing detail volition be retrieved. In the following recipe, pills from the list are used direct in the Log bulletin action.

Example recipe using list pills directly Recipe using list pills directly in Log message action. Case recipe (opens new window)

In the chore details page, the trigger output displays all three lines within the CSV file.

CSV trigger output Trigger output details displaying lines within the CSV file

As the Log message activity uses only datapills directly from the list, without handling the listing in any style, only the first line'due south data is retrieved.

Log message result Log message input displaying merely the beginning line of information

# Using datapills in an action with a list input (action handles list processing implicitly)

Some actions will take a list as input for instance, Salesforce bulk insert and bulk update actions, create journal entry deportment for accounting apps, create sales order actions for ERP apps.

The following is an example scenario that imports new products from a Box CSV file into Salesforce via the Bulk insert action.

Example recipe using list input Example recipe using listing input. Example recipe (opens new window)

Actions that take lists as inputs volition have an input field called Source list, which will only have in list pills. When these list input fields are selected, the datatree changes to offer only list pills. The Rows list object pill is mapped into the Salesforce product source list input field.

For the listing object passed into the input source list, the list volition exist transferred from the source app to the target app, with the values beingness transferred based on the fields mapped in the recipe. The three inventory items will be moved from Box into Salesforce as products.

The post-obit shows the CSV file content.

CSV trigger output Trigger output details displaying lines inside the CSV file

The action output in the job history shows that three products accept been created accordingly in Salesforce.

Salesforce bulk insert via input list Salesforce bulk insert via listing input

# Using datapills in an action with a Repeat step (action does non handle list processing, list processing needs to be done explicitly at the recipe logic level)

In this example scenario, let's import a listing of new inventory items (recorded inside a CSV file merely uploaded into Box) into a NetSuite case. At that place is a list to read from with the Box connector's New CSV file trigger, merely no list processing capabilities in the NetSuite connector's Add inventory item activeness.

In society to motility through the list and create three NetSuite inventory items, the Echo stride should be used to iterate through the listing, and carry out the aforementioned action for each iteration.

Example recipe using repeat step Recipe using repeat footstep to iterate through NetSuite list of inventory items. Example recipe (opens new window)

To iterate through the Rows list, pass the Rows list object as input for the repeat step. The recipe will therefore iterate through the list thrice to repeat the "Add inventory detail" action thrice, with unlike values from different CSV lines each time.

Repeat step input list Provide the listing object every bit input for repeat step

When using the Repeat step, the important thing to annotation is to remember datapills from the For each datatree.

Mapping from foreach datatree Mapping datapills from the Foreach datatree

This ensures that, when the list is being iterated through, the first Add inventory particular step uses the start line:

The second Add inventory particular stride uses the second line:

And the third Add inventory item footstep uses the third line:

# Mutual mistake when using Repeat step

Every bit discussed hither, using pills directly from the list object in the datatree without list handling will result in the first list item being used. Hence, if datapills from the listing object (instead of datapills from the Repeat step) are used inside the Repeat step, the recipe still iterates through the 3 CSV lines, but instead of using values from each line with every iteration, only values from the first line will be used for all 3 iterations, resulting in duplication.

Recipe with direct mapping from list Example of a recipe with INCORRECT (straight) mapping from list instead of from the Repeat stride. Example recipe (opens new window)

# List connector (Accumulator)

The list connector is a Workato tool built for users to create custom lists and store data in the list for the duration of a chore, to be used in the same job. It is commonly used for users to set up a list to write to an action with a list input.

# Using the accumulator activity to create a custom listing

# Defining the listing fields

A custom list has to exist created before data can be accumulated and stored inside it. To create the list, select List by Workato. Choose the default action Accumulate items to list.

List by Workato List by Workato

Define the fields in the custom list by configuring field name, type, and hint.

The custom list can also be edited via its JSON representation.

Editing custom list JSON Editing the custom list'south JSON representation

Mapping fields from repeat step

Ensure that the listing is within a Repeat step and that the datapills are mapped from the Repeat step's output datatree. This ensures that the iterated listing items' values are mapped into the custom list accordingly, and that values are not being duplicated within the list because the wrong pills from the main datatree (as opposed to the Repeat step'south datatree) were mapped as shown to a higher place.

# Example recipes that use accumulator, list input and Echo step

Let'due south accept the scenario whereby closed-won Salesforce opportunities with a list of opportunity products need to be moved into NetSuite as sales orders with a similar list of line items.

The NetSuite connector'southward Create sales order action takes in a list of line items that reference the inventory items' internal NetSuite ID. This ways that users similarly demand to have a list of NetSuite inventory detail IDs to create the NetSuite sales lodge in a single action. However, from Salesforce, only Salesforce opportunity products' IDs are available. In order to obtain the NetSuite inventory items' internal IDs, users would have to search for the correct NetSuite inventory particular by its Salesforce opportunity production name, and and so pass the NetSuite internal ID of the plant NetSuite inventory item into the Create sales guild action.

Using accumulator + list input. Iteratively build a custom list of NetSuite inventory items from the Salesforce opportunity product list, then create the complete NetSuite sales lodge with lines in a unmarried action**

Iterate through the Salesforce list of opportunity products via a Echo step to find corresponding NetSuite inventory items, and accumulate that in a custom listing. Subsequently, create a consummate NetSuite sales order with a list of line items in a unmarried action, past passing in the custom list built with accumulator.

Example recipe using accumulator Salesforce-Netsuite recipe using Repeat stride. Example recipe (opens new window)

pollittirly1959.blogspot.com

Source: https://docs.workato.com/features/list-management.html

Postar um comentário for "How to Bulk Upload Salesorder With Line Items in Netsuite"