Session 7 / 15๐Ÿ”Žืขื‘

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

  1. Master array functions: map, sort, distinct, slice, merge, sum.
  2. Extract information from text with the Text parser and regex.
  3. Produce CSV, HTML tables and JSON from data.
  4. Know Make Code (JavaScript / Python) and decide when it pays off.
  5. Calculate KPIs (total, average, leader, weekly change).
  6. Send a report with an attached file.
  7. Build an automatic weekly sales report.

Session agenda (3 hours)

  1. 00:00โ€“00:15 Review: the payment reminders
  2. 00:15โ€“00:50 Advanced array functions
  3. 00:50โ€“01:15 The Text parser and regex
  4. 01:15โ€“01:30 โ˜• Break
  5. 01:30โ€“01:50 CSV, HTML and files
  6. 01:50โ€“02:15 Make Code: JavaScript and Python
  7. 02:15โ€“02:50 Building together: a weekly sales report
  8. 02:50โ€“03:00 Summary and practice

What to prepare for this session

A sales sheet

30 rows: date, agent, product, amount, region.

Regex101

https://regex101.com (opens in a new window)
Testing expressions.

Make Code

https://apps.make.com/code (opens in a new window)
Available on paid plans. On Free we work with functions only.

Array 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.

The Text parser โ€” extracting from text

ModuleWhat it doesExample
Match patternRegex with (named) groupsExtracting an order number from an email
ReplaceReplace with regexRemoving a signature
HTML to textCleaning HTMLEmail content for an AI agent
Get elements from HTMLExtract by tagLinks 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.

CSV, HTML and files

NeedHow
CSV from dataCSV โ†’ Create CSV (advanced) with a data structure, or a Table aggregator with a comma separator
CSV to dataCSV โ†’ Parse CSV โ†’ a bundle per row
An HTML tableA Text aggregator that builds a <tr> per row, wrapped in a <table>
A file from textAny text can be attached: file name + data (Make converts it to binary)
ExcelMicrosoft 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>

Make 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] };
ConsiderationDetails
AvailabilityPaid plans (on Enterprise also custom libraries)
CostAbout 2 Credits per second of runtime โ€” short code usually runs under a second
LimitsNo network access from inside the code โ€” API calls go in an HTTP module before it
When yesComplex calculations that would need 5+ modules, complicated JSON processing, algorithms
When notWhen 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.

Weekly KPIs โ€” what to measure

0
sales this week
0
deals
0
average deal
KPICalculation in Make
Totalsum(map(array; "amount"))
Number of dealslength(array)
Averageround(total / deals)
Top agentArray aggregator with Group by agent โ†’ Numeric SUM โ†’ sort
Change vs. last weekTwo Search Rows (this week / last week) โ†’ round((a-b)/b*100)
Top 3 productsGroup by product โ†’ sort desc โ†’ slice 0โ€“3

Building 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.