๐ฌWhat we learn today โ a short video
โก By the end of the session you will know
- Array functions (map, sum, sort, distinct, slice) save modules and Credits.
- The Text parser with regex extracts from text in a fixed format.
- CSV and HTML are built with aggregators; a BOM for Excel.
- Make Code runs JS/Python on paid plans โ when you really need it.
- We built an automatic weekly sales report.
A silent video of about half a minute: the session topic, the learning goals (also listed in the next section) and the scenario we build today.
๐The story of Etz va'Or (Wood & Light) โ Chapter 7: The Sunday report
The accountant asked for a weekly sales report. Instead of Maya copying numbers into Excel every Sunday, Make will calculate KPIs, build a nice HTML table, attach a CSV and send it to both of them.
๐งต One story across the whole course: every session solves a real problem for the business. At the end โ a complete system.
๐ฏSession goals
- Master array functions: map, sort, distinct, slice, merge, sum.
- Extract information from text with the Text parser and regex.
- Produce CSV, HTML tables and JSON from data.
- Know Make Code (JavaScript / Python) and decide when it pays off.
- Calculate KPIs (total, average, leader, weekly change).
- Send a report with an attached file.
- Build an automatic weekly sales report.
๐๏ธSession agenda (3 hours)
- 00:00โ00:15 Review: the payment reminders
- 00:15โ00:50 Advanced array functions
- 00:50โ01:15 The Text parser and regex
- 01:15โ01:30 โ Break
- 01:30โ01:50 CSV, HTML and files
- 01:50โ02:15 Make Code: JavaScript and Python
- 02:15โ02:50 Building together: a weekly sales report
- 02:50โ03:00 Summary and practice
1Array functions โ power without modules
Often you can compute in one field what would have needed an Iterator + aggregator. That saves Credits and also makes the scenario simpler.
๐ก map with filteringmap(array; key; filterKey; filterValue) returns only the values that meet the condition โ like Filter + Iterator + aggregator, in one field. It's one of the most useful tricks in Make.
2The Text parser โ extracting from text
| Module | What it does | Example |
|---|
| Match pattern | Regex with (named) groups | Extracting an order number from an email |
| Replace | Replace with regex | Removing a signature |
| HTML to text | Cleaning HTML | Email content for an AI agent |
| Get elements from HTML | Extract by tag | Links from a page |
Email: "Order no. 48213 received. Amount: ILS 1,250.00. Delivery by 14/11/2026"
Pattern: Order no\.? (?<order>\d+).*?ILS (?<amount>[\d,.]+).*?(?<date>\d{2}/\d{2}/\d{4})
Output: order = 48213 amount = 1,250.00 date = 14/11/2026
โน๏ธ Regex or AI?Regex is fast, cheap and precise when the format is fixed (emails from a system). When the text is free and varies โ AI (session 9). A common combination: regex first, and AI only if nothing was found.
3CSV, HTML and files
| Need | How |
|---|
| CSV from data | CSV โ Create CSV (advanced) with a data structure, or a Table aggregator with a comma separator |
| CSV to data | CSV โ Parse CSV โ a bundle per row |
| An HTML table | A Text aggregator that builds a <tr> per row, wrapped in a <table> |
| A file from text | Any text can be attached: file name + data (Make converts it to binary) |
| Excel | Microsoft Excel / Google Sheets โ export, or a CSV that opens in Excel |
โ ๏ธ Special characters in CSV and ExcelExcel may open a UTF-8 CSV without a BOM as gibberish. Add the \uFEFF character (BOM) at the start of the file, or send a Google Sheet instead of a CSV.
Text aggregator (Source: Search Rows):
<tr><td>{{agent}}</td><td>{{product}}</td><td style="text-align:right">ILS {{formatNumber(amount; 0; "."; ",")}}</td></tr>
Gmail Content:
<div><table border="1" cellpadding="6" style="border-collapse:collapse">
<tr style="background:#6d00cc;color:#fff"><th>Agent</th><th>Product</th><th>Amount</th></tr>
{{5.text}}
</table></div>
4Make Code โ when functions aren't enough
Make Code โ Run code runs JavaScript (Node) or Python inside the scenario. You get mapped input, return an object, and the output is mapped onwards as usual.
// JavaScript โ weekly KPIs
const rows = input.rows; // an array mapped from the Array aggregator
const total = rows.reduce((s, r) => s + Number(r.amount), 0);
const byAgent = {};
rows.forEach(r => byAgent[r.agent] = (byAgent[r.agent] || 0) + Number(r.amount));
const top = Object.entries(byAgent).sort((a, b) => b[1] - a[1])[0];
return { total, deals: rows.length, avg: Math.round(total / rows.length), topAgent: top[0], topAmount: top[1] };
| Consideration | Details |
|---|
| Availability | Paid plans (on Enterprise also custom libraries) |
| Cost | About 2 Credits per second of runtime โ short code usually runs under a second |
| Limits | No network access from inside the code โ API calls go in an HTTP module before it |
| When yes | Complex calculations that would need 5+ modules, complicated JSON processing, algorithms |
| When not | When one function does the job โ it's less readable for people who don't code |
๐ก AI can write the code tooWrite to ChatGPT/Claude: "Write JavaScript code for Make Code that takes input.rows (an array with agent, amount) and returnsโฆ" โ and test with Run once. But always understand what the code does before putting it into production.
5Weekly KPIs โ what to measure
| KPI | Calculation in Make |
|---|
| Total | sum(map(array; "amount")) |
| Number of deals | length(array) |
| Average | round(total / deals) |
| Top agent | Array aggregator with Group by agent โ Numeric SUM โ sort |
| Change vs. last week | Two Search Rows (this week / last week) โ round((a-b)/b*100) |
| Top 3 products | Group by product โ sort desc โ slice 0โ3 |
6Building together: a weekly sales report
โน๏ธ Two aggregators from the same searchYou can connect both an Array aggregator (for the KPIs) and a Text aggregator (for the table) from the same source โ through a Router after the search, or compute the table from the array with functions. In the solution we show the simple way: a Router with two routes that connect to a data store / Set variable.
๐งชLab: simulations and examples
Three ways to see today's material in action: the scenario canvas runs the session's scenario like Make does (with a Credits count), the race compares manual work with automation, and the function playground shows real mapping examples.
๐ก Why in this order?Compute the numbers once; the HTML and the CSV are both built from the same data, so their order doesn't matter.
๐ขA real-world case study
"Shahar Shoes" โ a chain of stores. Every Sunday an analyst spent 4 hours on a sales report: downloading from the registers, Excel, a screenshot to WhatsApp. A Make scenario that pulls the sales, computes KPIs (including a comparison with last week and the same week last year), produces an HTML table and a CSV file, and sends it to the managers at 07:30. Result: 200 hours a year, and the report arrives before the management meeting and not after it.
โFrequently asked questions
Make Code isn't available to me
It's on paid plans. Everything in the project can also be done with functions and aggregators.
Why map with filtering and not a filter?
A filter stops whole bundles. map with filtering works inside an array โ without extra modules.
Can I produce a PDF?
Yes, through services (PDFMonkey, CraftMyPDF, Google Docs โ Download as PDF). From HTML the simplest: a Docs template โ PDF.
How many rows can an aggregator hold?
Many, but there is a size limit for a bundle. For thousands of rows โ work in batches.
โ๏ธQuick understanding check
โก๏ธWhat now?
You finished the lecture! Go to the practice page โ multiple-choice questions and tasks that build A weekly sales report: Sheets โ KPI calculations โ an HTML table โ an attached CSV โ Gmail + Telegram. Stuck? The help guide breaks every task into steps. Only after you have tried, peek at the full solution.