I have an array with order lines that I intend to send in via the Xero node as a draft Invoice. Issue is that I might have 1 or 30 order lines depending on the order.
Easiest way would be to have a split off where one workflow path handles the orderlines. You can use the item list node to split the lines, then you can process them and combine them again. After that simply merge them back into the main flow of the invoices.
Ah, now I see, sorry I didn’t realise how the node works.
No Idea how you would pull this one off with the node, without doing some bizarre stuff.
I think using a manual request with the HTTP node is the easiest way to get going.
At the moment the node doesn’t have support for paying invoices so we would need to create a feature request for that one, With the multi line items I can’t see a way to do it but I can see why it would be useful to have it although I am not sure why this has not come up before unless I have missed it.
I did think maybe a loop would do the job and you could create an invoice, store the ID then on the next loop just update the invoice to add new line items but it looks like the node replaces the line items which is not ideal.
At the moment the best I can suggest would be to use the HTTP Request node and create a new generic oauth option that contains the scopes required until we update the node or someone else pops in a pull request / creates a community version.
Just to be complete and share a workflow that doesn’t work as intended but shows what I was thinking
Hey @Jon, I’m also trying to work a solution for this. I noticed the following line in the Xero API instructions for Posting Invoice Updates.
Not providing an existing LineItem with it’s LineItemID will result in that line item being deleted.
I’m pretty sure this is what has been thwarting my attempts to get multi-line invoices working so far. Wondering if this may be relevant for your workflow too?