Iterators in Call URL Actions

Let’s take an integration with Xero accounting software as an example.

As Xero reports Invoice information together with line items, we can use iterators to copy all invoice data in one shot. Xero’s invoice information is quite long, here is an excerpt with some essential info:

<Response>
  <Invoices>
    <Invoice>
      <InvoiceID>01234567-0123-4567-8901-012345678901</InvoiceID>
      <Date>2021-01-01T00:00:00</Date>
      <Contact>
        <Name>John Doe</Name>
      </Contact>
      <LineItems>
        <LineItem>
          <LineItemID>01234567-0123-4567-8901-012345678901</LineItemID>
          <Description>Acme Wild-Cat</Description>
          <UnitAmount>100.00</UnitAmount>
          <Quantity>2.0000</Quantity>
        </LineItem>
        <LineItem>
          <LineItemID>98765432-3210-3210-3210-109876543210</LineItemID>
          <Description>Weyland-Yutani Xenomorph</Description>
          <UnitAmount>200.00</UnitAmount>
          <Quantity>1.0000</Quantity>
        </LineItem>
      </LineItems>
    </Invoice>
  </Invoices>
</Response>

Iterators in Call URL actions are organized the same way as in webhooks, so we won’t repeat the step-by-step guide from above, just the final result:

Iterators in Call URL Actions

Please note the use of the ParentKey() function - it will allow you to connect newly created line items to their parent invoice record.