Skip to main content
Question

XML Line Items


Hi all,

The XML we are need to send has nested line items and the source data sends line items as a list. We can use formatter (Utilities > Line Itemizer) to separate them out but we are struggling to implement them in the nest format required because it seems not all actions support Zapier's line items functionality.

Our XML needs to follow this rough structure:

<ITEM>
<SKU>2345</SKU>
<QTY>3</QTY>
<Price>200</Price>
<LineNumber>1</LineNumber>
</ITEM>

<ITEM>
<SKU>1235</SKU>
<QTY>2</QTY>
<Price>300</Price>
<LineNumber>2</LineNumber>
</ITEM>

<ITEM>
<SKU>1555</SKU>
<QTY>2</QTY>
<Price>400</Price>
<LineNumber>3</LineNumber>
</ITEM>

At the moment, all we are able to do is:

<ITEM>
<SKU>2345, 1235, 1555</SKU>
<QTY>3, 2, 2</QTY>
<Price>200, 300, 400 </Price>
<LineNumber>1, 2, 3</LineNumber>
</ITEM>

Any ideas how we might achieve this?

Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

nicksimard
Forum|alt.badge.img+11
  • Zapier Staff
  • 2115 replies
  • October 9, 2020

Hi @Squircle!

Would you be able to elaborate a bit on what your overall workflow looks like? What’s the trigger and what’s the action? Just trying to make sure we can get an accurate picture of what the whole process would entail here so we can get you an answer :)

Thanks!


  • Author
  • Beginner
  • 1 reply
  • October 13, 2020
  1. A Woocommerce order is placed.
  2. The output needs to be an XML doc in a specific format for a large distribution company
  3. If the trigger is per line item, it triggers for each line item, which isn’t what we want.
  4. We simply want the trigger to be on “order paid” but include a section in the XML that splits each line item from the order into this format:
    <ITEM>
    <SKU>2345</SKU>
    <QTY>3</QTY>
    <Price>200</Price>
    <LineNumber>1</LineNumber>
    </ITEM>
    
    <ITEM>
    <SKU>1235</SKU>
    <QTY>2</QTY>
    <Price>300</Price>
    <LineNumber>2</LineNumber>
    </ITEM>
    
    <ITEM>
    <SKU>1555</SKU>
    <QTY>2</QTY>
    <Price>400</Price>
    <LineNumber>3</LineNumber>
    </ITEM>
  5. So, a new <ITEM> for each line item to be included in a single order
  6. We then are currently using “Create File from Text” to create the XML file.
  7. Any help would be much appreciated!