Working with Line Items in Zoho Flow

Working with line items

Overview 

A line item is an individual entry or row in a record or document, such as an order, invoice, purchase order, packing list, or inventory record. Unlike regular fields, which hold just one value, each line item field can have multiple values. In technical terms, they are arrays of objects.

For example:

• The products on an invoice in Zoho Books, each with a name, quantity, rate, and tax.

           • The items on a sales order in Zoho Inventory, each with a SKU, quantity, and discount.

• The entries on a purchase order, each for a different product from a vendor.

 

Before line item support, passing this kind of data from one app to another required writing custom formulas to extract individual rows by index, or building custom functions to construct the array from scratch. This made the process fragile and time-consuming.

With line item support in Zoho Flow, you can map all rows at once, control exactly how each field is populated across every row, and handle dynamic record counts without writing a single line of code.

Why line items are important in workflows? 

Let's look into a sample use case where you want to create a sales order in Zoho Inventory whenever a new order is placed in WooCommerce. The WooCommerce trigger returns a list of ordered products, each with a name, quantity, unit price, discount, and tax. You need all of these to appear as individual rows in the Zoho Inventory sales order.

The old approach:  without line item support

Without line item support, the only way to pass multi-row data was to extract each row individually, then map each field one by one.

For a WooCommerce order with three products, you would map every field for every row separately:

Item name (1) → Name

Quantity (1) → Quantity

Rate (1) → Price

 

Item name (2) → Name

Quantity (2) → Quantity

Rate (2) → Price

 

Item name (3) → Name

Quantity (3) → Quantity

            Rate (3) → Price

This approach has significant drawbacks:

  • The flow only works for a fixed number of rows. If the record has more or fewer items than expected, rows will be missing or the flow will fail.

  • Every field needs to be mapped separately for every row, making the setup tedious and error-prone.

  • If the trigger's field structure changes, every mapped row breaks and has to be fixed individually.

  • Handling a dynamic number of rows requires a custom function, which needs programming knowledge.


The new approach:
 with line item support

With line item support, Zoho Flow recognises when a trigger or previous action returns array data and presents it as a mappable line items variable in the action configuration. You configure the fields once, and Zoho Flow will apply the mapping across all rows automatically, regardless of how many rows the trigger or the previous action returns.

 

In the above example discussed, every product in the WooCommerce order appears as a correctly populated row in the Zoho Inventory sales order. No formulas. No custom functions. No hard-coded row count. This works as long as both applications share a compatible field structure, otherwise you could map fields individually.


NotesNote: If an action does not support line items, the line item section will not appear in its configuration panel.


Line items and field groups 

When configuring an action that supports structured data, you may encounter two types of grouped fields: line item and field group. Although they may look similar in the configuration panel, they behave differently.

When to use line item

Map a line item variable to a line item field when you are passing multiple rows of related data where each row has its own set of values. For example:

  • Products on an invoice, each with a name, quantity, rate, and tax

  • Items on a sales order, each with a SKU, quantity, and discount

  • Phone numbers on a contact, each with a number, type, and country code

When to use field group

Map a field group variable to a field group field when you are passing a single grouped record(one set of values) from one application to another. For example:

  • Copying a contact's billing address (street, city, state, zip) from one application to another

  • Passing a shipping address from an order to a record in the destination application

The key difference from line items: there are no multiple rows involved. It's a one-to-one transfer of a fixed group of fields. If you're moving a list like multiple products or multiple phone numbers use a line item field instead.


Line items
Field group
Represent multiple records (rows).
Represent a single grouped record.
Support array-based value assignment.
Do not support array-based value assignment.
Each row can receive an array of values (position-based).
Represents a single record. Each field holds one value, and there are no multiple rows.
Example: order items, invoice products, purchase entries.
Example: billing address, shipping address.


Identifying line items in Zoho Flow

In the action configuration panel

Fields that support line items are marked with a line item badge next to the field label. When you click on such a field, you will see a Map as option with two choices: Bulk and Field-by-Field letting you choose how to configure the line item fields.


      

In the Insert variable panel

On the right side of the action configuration, the Insert variable panel lists all available variables from your trigger and previous steps, grouped by step.

Variables that contain line item data are marked with a line item tag, and variables that contain field group data are marked with a field group tag. Click the expand icon next to either to reveal the individual fields within, each shown with its data type, such as string or number. Click any variable to map it to the respective field.

Variables without a tag are standalone single-value variables and can be mapped directly.

Configuring line items 

When you open an action that supports line items, you will see a line item section in the configuration panel. You can configure it in two ways: Bulk and Field-by-Field.

Bulk
Field-by-Field
Bulk
Bulk configuration lets you map the entire line item array from a previous step to the action in one step. Use this when both the applications have a compatible structure and you want to pass all fields without reviewing them individually. Follow the steps below to do the mapping.
  1. In the action configuration panel, locate the line item section and click Bulk.

  2. In the Insert variable section on the right, select the line item variable from the trigger or previous action's output. Zoho Flow maps the line item variable directly to the line item field.



Here, the Phones field is mapped to ${fetchContact_2.Phones} the entire line item variable from the previous step is passed to the field in one go, and all phone rows are transferred automatically.

      

You can also enter values directly as an array. For example, to add multiple phone numbers to the Phones field, enter the values in the format below and each entry will be created as a separate phone record in the Xero contact.
[{"phonenumber":"555 0132","phoneareacode":"415"},{"phonenumber":"555 0198","phoneareacode":"212"},{"phonenumber":"555 0147","phoneareacode":"416"}]

  • Phone number (1) → 555 0132

  • Phone number (2) → 555 0198

  • Phone number (3) → 555 0147

  • Phone area code (1) → 415

  • Phone area code (2) → 212

  • Phone area code (1) → 416

where Phone number and Phone area code are the fields within the Phones line item field.


NotesNote: Bulk configuration works only when both applications use the same field structure.


Field-by-Field

Field-by-Field lets you configure each line item field individually. For every field, you can either map a value from a previous step, type a value directly, or if the field offers a dropdown, pick from a list of options.

Regardless of how you assign a value, you also control how it is distributed across rows:

  • As an array - Pass a list of values in JSON format. Each value is assigned to the corresponding row by position. Rows with no matching value are marked as null.



    Here, the Phone number field is mapped to ${fetchContact_2.Phones.PhoneNumber}, meaning it pulls the phone number directly from the Phones line item variable returned by the previous step, and assigns each number to the corresponding row automatically. 

    Another example, when a trigger returns 4 line items and City is mapped as an array.

    Input: ["New York", "Los Angeles", "Chicago", "Houston"]

     

    Row 1  →  New York

    Row 2  →  Los Angeles

    Row 3  →  Chicago

    Row 4  →  Houston

    Whereas, when you pass a single value as an array with only one entry, it is assigned to the first row only. The remaining rows receive null value.

    Input: ["New York"]

     

    Row 1  →  New York

    Row 2  →  null

    Row 3  →  null

    Row 4  →  null

    • As a single value - Pass one value and it is applied to every row. Use this for fields that are the same across all line items, such as a warehouse location, currency, or country code.



      In this example, a single value is passed to the Phone country code field, so the same value is applied to all the rows.

      Input: Phone country code - +1

 

Row 1  →  +1

Row 2  →  +1

Row 3  →  +1

Row 4  →  +1

      For fields with a dropdown, you can either select an existing option which applies the same value to all rows or enter a custom       value. Custom values support array input, so you can assign a different option to each row. 


            

      For example, the phone type differs per item. Select custom value and enter the values in the below format.

      Input: ["Mobile", "Work", "Fax"]

 

            Row 1  →  Mobile

            Row 2  →  Work

            Row 3  →  Fax

            Row 4  →  (empty)

 


NotesNote: Arrays must follow valid JSON format. String values must be enclosed in double quotes, for example, ["Active", "Inactive"] is valid, but [Active, Inactive] is not. Numeric values do not require quotes.



How values are distributed across rows 

The table below shows how a value is assigned to rows, depending on how you enter it.

Assignment mode
Input
Rows
Result
Array input - mapped from previous step
Line items array
Matches source
Each row receives its value by position
Single value - mapped from previous step
Any single field
Any
All rows receive the same mapped value
Typed directly - array
["A", "B", "C"]
5
Row 1=A,
Row 2=B,
Row 3=C,
Rows 4–5=empty
Typed directly - Single value
Active
5
All 5 rows = Active
Selected from a dropdown
Select: Approved
5
All 5 rows = Approved
Custom value - array(line item)
["Approved", "Pending"]
5
Row 1=Approved,
Row 2=Pending,
Rows 3–5=empty
Custom value - single(field group)
"Approved"
Any
All rows =Approved


NotesNote: When using array input, missing positions are null. Extra values beyond the row count are ignored.

Limitations 

  • Not all applications support line items. If the line items section doesn't appear in an action, that app doesn't support it.

  • Field groups don't support array input.

  • Dropdown fields in field groups only accept a single selected option, custom values with array input aren't supported.


Frequently asked questions 

I mapped the trigger's line items array to a field but only the first row appears in the action. What went wrong?

This usually means the field you mapped to is a field group field, not a line item field. Field groups represent a single record and do not support arrays. Make sure you are mapping into the line items section of the action, not into a field group.

Can I apply a different value to each row in a dropdown field?

Yes, but only for line item fields and not field groups. In a line item dropdown field, choose Custom value and enter a JSON array. Each value maps to the corresponding row by position. This is not applicable for dropdown fields in field groups.

Do I need a custom function if both my trigger and action support line items?

In most cases, no. If both applications support line items and the field structures are reasonably compatible, you can map everything directly in the Line items configuration panel. Custom functions are needed only when you need to restructure, filter, or transform the data for example, to exclude certain rows, calculate a derived value, or reformat a field.

What happens if the trigger returns no line items?

If the trigger returns an empty line items array, no rows will be created in the action. The flow will still complete successfully, but the record in the destination app will have no line item entries. To handle this, add a condition step before the action to check that the line items array is not empty before the flow proceeds.

What happens when fields in a Field-by-Field configuration have arrays of different lengths?

The total number of rows created is determined by the longest array across all mapped fields. If Name is mapped as a 4-value array and Quantity as a 3-value array, four rows will be created. Row 4 will have a name but its Quantity will be null. To avoid this, make sure all field arrays have the same number of values.

What happens if I include a null value inside an array?

The null is treated as an empty value for that position. For example, if you enter ["New York", null, "Chicago"], row 1 gets New York, row 2 gets an empty value, and row 3 gets Chicago. The row itself is still created, it is not skipped.


        Create. Review. Publish.

        Write, edit, collaborate on, and publish documents to different content management platforms.

        Get Started Now


          Access your files securely from anywhere

            Zoho CRM Training Programs

            Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

            Zoho CRM Training
              Redefine the way you work
              with Zoho Workplace

                Zoho DataPrep Personalized Demo

                If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

                Zoho CRM Training

                  Create, share, and deliver

                  beautiful slides from anywhere.

                  Get Started Now


                    Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                    BOOK A SESSION







                                Quick LinksWorkflow AutomationData Collection
                                Web FormsEnterpriseOnline Data Collection Tool
                                Embeddable FormsBankingBegin Data Collection
                                Interactive FormsWorkplaceData Collection App
                                CRM FormsCustomer ServiceAccessible Forms
                                Digital FormsMarketingForms for Small Business
                                HTML FormsEducationForms for Enterprise
                                Contact FormsE-commerceForms for any business
                                Lead Generation FormsHealthcareForms for Startups
                                Wordpress FormsCustomer onboardingForms for Small Business
                                No Code FormsConstructionRSVP tool for holidays
                                Free FormsTravelFeatures for Order Forms
                                Prefill FormsNon-Profit

                                Intake FormsLegal
                                Mobile App
                                Form DesignerHR
                                Mobile Forms
                                Card FormsFoodOffline Forms
                                Assign FormsPhotographyMobile Forms Features
                                Translate FormsReal EstateKiosk in Mobile Forms
                                Electronic Forms
                                Drag & drop form builder

                                Notification Emails for FormsAlternativesSecurity & Compliance
                                Holiday FormsGoogle Forms alternative GDPR
                                Form to PDFJotform alternativeHIPAA Forms
                                Email FormsFormstack alternativeEncrypted Forms

                                Wufoo alternativeSecure Forms

                                TypeformWCAG

                                  Zoho FSM Video Tutorials


                                        All-in-one knowledge management and training platform for your employees and customers.

                                                  Create. Review. Publish.

                                                  Write, edit, collaborate on, and publish documents to different content management platforms.

                                                  Get Started Now




                                                                    You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                                        Manage your brands on social media


                                                                          • Desk Community Learning Series


                                                                          • Digest


                                                                          • Functions


                                                                          • Meetups


                                                                          • Kbase


                                                                          • Resources


                                                                          • Glossary


                                                                          • Desk Marketplace


                                                                          • MVP Corner


                                                                          • Word of the Day


                                                                          • Ask the Experts


                                                                            Zoho Sheet Resources

                                                                             

                                                                                Zoho Forms Resources


                                                                                  Secure your business
                                                                                  communication with Zoho Mail


                                                                                  Mail on the move with
                                                                                  Zoho Mail mobile application

                                                                                    Stay on top of your schedule
                                                                                    at all times


                                                                                    Carry your calendar with you
                                                                                    Anytime, anywhere




                                                                                          Zoho Sign Resources

                                                                                            Sign, Paperless!

                                                                                            Sign and send business documents on the go!

                                                                                            Get Started Now




                                                                                                    Zoho TeamInbox Resources





                                                                                                              Zoho DataPrep Demo

                                                                                                              Get a personalized demo or POC

                                                                                                              REGISTER NOW


                                                                                                                Design. Discuss. Deliver.

                                                                                                                Create visually engaging stories with Zoho Show.

                                                                                                                Get Started Now








                                                                                                                                    • Related Articles

                                                                                                                                    • MYOB Business

                                                                                                                                      What is MYOB Business? MYOB (Mind Your Own Business) Business offers business management solutions like accounting, payment, CRM, and professional tax solutions. How to connect your MYOB Business account to Zoho Flow Select the required trigger and ...
                                                                                                                                    • Zoho Projects

                                                                                                                                      What is Zoho Projects? Zoho Projects is a project management application from Zoho that helps teams plan work, track progress, collaborate on tasks, and deliver projects on time. It supports modules like milestones, tasks, subtasks, issues (formerly ...
                                                                                                                                    • Data mapping

                                                                                                                                      Introduction Data mapping is using the variables of a trigger or action as input for the next steps of the flow. It lets you decide how data should be organized when the flow is processing. With mapped data you can create a consistent flow of ...
                                                                                                                                    • Working with date and time values in Zoho Flow

                                                                                                                                      Different apps talk about date and time values in different ways. American, European, International—there are so many date formats, that it's a challenge to transfer date-time values across apps automatically. Some apps may not accept other date ...
                                                                                                                                    • Xero

                                                                                                                                      What is Xero? Xero is a cloud-based accounting platform that helps businesses manage finances, including invoicing, bank reconciliation, expense tracking, payroll, and financial reporting. It is commonly used by small to medium-sized businesses and ...
                                                                                                                                      Wherever you are is as good as
                                                                                                                                      your workplace

                                                                                                                                        Resources

                                                                                                                                        Videos

                                                                                                                                        Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                                        eBooks

                                                                                                                                        Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                                        Webinars

                                                                                                                                        Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                                        CRM Tips

                                                                                                                                        Make the most of Zoho CRM with these useful tips.



                                                                                                                                          Zoho Show Resources