# QuickBooks Online

## Creating an invoice with a variable number of line items

A common use-case is that you might want to create an invoice in QuickBooks Online populated from a list of items in other data sources (for example, from a number of rows in a spreadsheet).

Setting this up requires a few extra steps, namely:

* Creating the line items for each input using an iterator
* Unrolling the list of line items from the iterator into the invoice creation

As an example, consider the following spreadsheet containing rows, where each row represents an invoice line item:

<figure><img src="/files/4QtbYuGzuOuRcSGtmy2a" alt="Spreadsheet showing invoice line items with columns for Item, Description, Quantity, and Rate to be used in QuickBooks invoice creation"><figcaption></figcaption></figure>

To populate line items from this spreadsheet, we would first retrieve a list of the spreadsheet rows, using a find step:

<figure><img src="/files/9vzkywlq83woU4t8whTe" alt="Relay.app Google Sheets Find step configuration showing selection of rows from the spreadsheet to retrieve invoice line item data"><figcaption></figcaption></figure>

Next, we would use an iterator, along with a quickbooks **Create Invoice Line Item** step to create a list of line-items:

<figure><img src="/files/KgAXTSPzKpfAiCXnktLn" alt="Relay.app workflow showing an iterator step connected to QuickBooks Create Invoice Line Item action to process multiple rows"><figcaption></figcaption></figure>

Finally, we can "unroll" the list of line-items to populate the line-items in the **Create invoice** step:

<figure><img src="/files/ZkTkgv7otKgir13pg0qj" alt="QuickBooks Create invoice step configuration showing line items field populated with unrolled data from the iterator output"><figcaption></figcaption></figure>


---

# 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.relay.app/app-specific-faqs/quickbooks-online.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.
