How to Sum Quantities from Xero Invoices using Make.com
Hi all!
Here's a common problem that some of us might have encountered: You want to search Xero invoices from the past 60 days and sum the total quantity for each item. It sounds simple, but you might find yourself getting tangled up with iterators, aggregators, and array functions. So, let's break it down step by step.
Problem
Let's say we sell 3 different widgets. We want a sum of the quantity invoiced for each widget within a 60-day time period. The challenge is how to sum the quantities up to a total.
Solution
Here's an approach you can try:
- Use the “Search Invoices” module in Make.com to retrieve invoices from Xero. Set the filter to get invoices from the past 60 days.
- Add an “Array Iterator” module to loop through each invoice retrieved in the previous step.
- Inside the array iteration, use the “Split Text” or other appropriate modules to extract line items (items sold) from the current invoice.
- Add another “Array Iterator” module to loop through each line item extracted from the invoice.
- Inside the second array iteration, use the “Aggregator” module to sum up the quantities for each item. You can use the item name or a unique identifier as a key for aggregation.
- After the iterations, you will have aggregated quantities for each item. You can format this data and output it as needed, such as writing it to a Google Sheet or sending notifications.
And that's it! You've successfully summed up the quantities of each item from your Xero invoices. Keep up the great work!
You do have further questions?
Ask your question via E-Mail: Richard@make-app.de
Book a paid Support & Consulting Session
New Make.com user? Sign up through this Affiliate Link to receive 10.000 operations for FREE.