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

How to work with the challenges

The challenges here are harder than the practice tasks, and are meant for those who finished and want to go deeper. Try on your own for at least 20 minutes before opening the hints, and the solution only after that. There is no single right solution: if your scenario meets the requirements, it is right.

Broken scenario โ€” find the bug

This is what real work looks like: something broke, and all you have is the History. Read the error, and pick the right fix.

Advanced: Top 3 products

๐Ÿ”ฅ Advancedโฑ๏ธ ~40 min

๐ŸŽฌ The scenario

Add the 3 best-selling products by amount to the report.

๐ŸŽฏ The requirements

  1. Group by product.
  2. Sort and cut to 3.
  3. Show as a list.

๐ŸŽฏ The desired result โ€” how the scenario should look and work

Click Run once and then each module: you will see its settings, and on the last module โ€” the output you should get.

๐Ÿ“ค Example of the final output
{
  "top3": [
    {
      "product": "TBL-01",
      "sum": 62000
    },
    {
      "product": "CHR-07",
      "sum": 38500
    },
    {
      "product": "SHF-02",
      "sum": 21000
    }
  ]
}

๐ŸŽฌ Stuck? To the guided solution with a click simulation โ†’

๐Ÿ’ก Hints (try without them first)
  • An Array aggregator with Group by product, then a Numeric aggregator? Possible โ€” or Make Code.

Search โ†’ Array aggregator (Group by: product) โ†’ Set variable sum = sum(map(array; "amount")) โ†’ a second Array aggregator (Source: the first) โ†’ slice(sort(array; "desc"; "sum"); 0; 3) โ†’ text. Or in code: reduce + sort + slice.

๐ŸŽฌ The guided solution โ€” a click simulation

๐Ÿ“ธ The illustrated guide โ€” step by step, click by click

For every step: a screenshot of the (simulated) Make editor with the click spot marked, and below it exactly what to click and what to type. You can work from here next to an open Make window.

  1. 1
    This week's sales
    Search Rows on the sales table.
    Marked screenshot โ€” step 1: This week's sales
    ๐Ÿ“ธ Step 1.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 1: This week's sales
    ๐Ÿ“ธ Step 1.2 โ€” the red ring marks where to click
    1. In the left menu click Scenarios โ†’ + Create a new scenario.
    2. Click the scenario name at the top left (New scenario) and type: C07 - Top 3.
    3. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    4. In the search box type Google Sheets and click the Google Sheets app.
    5. In the list of actions choose Search Rows.
    6. In the Sheet field type: sales
    7. Click OK (or Save) to close the module window.
  2. 2
    Group by product
    Array aggregator with Group by = product.
    Marked screenshot โ€” step 2: Group by product
    ๐Ÿ“ธ Step 2 โ€” the red ring marks where to click
    1. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    2. In the search box type Flow Control and click the Flow Control app.
    3. In the list of actions choose Array aggregator.
    4. In the Source Module field type: Google Sheets - Search Rows [1]
    5. In the Group by field map (drag from the panel or type): {{1.product}}
    6. Click OK (or Save) to close the module window.
  3. 3
    A sum per product
    Set variable sum = sum(map(array; "amount")).
    Marked screenshot โ€” step 3: A sum per product
    ๐Ÿ“ธ Step 3 โ€” the red ring marks where to click
    1. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    2. In the search box type Tools and click the Tools app.
    3. In the list of actions choose Set variable.
    4. In the Variable name field type: sum
    5. In the Variable value field map (drag from the panel or type): {{sum(map(2.array; "amount"))}}
    6. Click OK (or Save) to close the module window.
  4. 4
    Sort and cut to 3
    A second Array aggregator โ†’ slice(sort(...; "desc"; "sum"); 0; 3).
    Marked screenshot โ€” step 4: Sort and cut to 3
    ๐Ÿ“ธ Step 4.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 4: Sort and cut to 3
    ๐Ÿ“ธ Step 4.2 โ€” the red ring marks where to click
    1. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    2. In the search box type Flow Control and click the Flow Control app.
    3. In the list of actions choose Array aggregator.
    4. In the Source Module field type: Tools - Set variable [3]
    5. Click OK (or Save) to close the module window.
    6. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    7. In the search box type Tools and click the Tools app.
    8. In the list of actions choose Set variable.
    9. In the Variable name field type: top3
    10. In the Variable value field map (drag from the panel or type): {{slice(sort(4.array; "desc"; "sum"); 0; 3)}}
    11. Click OK (or Save) to close the module window.
  5. 5
    Run
    Three products in descending order.
    Marked screenshot โ€” step 5: Run
    ๐Ÿ“ธ Step 5 โ€” the red ring marks where to click
    1. Click โ–ถ Run once at the bottom left.
    2. When the run ends, bubbles with numbers appear above the modules. Click the bubble of the last module and check the Output.
    3. The output should look roughly like this:
      {
       "top3": [
        {
         "product": "TBL-01",
         "sum": 62000
        },
        {
         "product": "CHR-07",
         "sum": 38500
        },
        {
         "product": "SHF-02",
         "sum": 21000
        }
       ]
      }

Experts: Extracting invoices from PDF

๐Ÿ”ฅ๐Ÿ”ฅ Expertsโฑ๏ธ ~50 min

๐ŸŽฌ The scenario

A supplier sends a PDF with an invoice in a fixed format. Extract the number and the amount.

๐ŸŽฏ The requirements

  1. Gmail Watch emails with files.
  2. Convert PDF to text.
  3. Regex for extraction.

๐ŸŽฏ The desired result โ€” how the scenario should look and work

Click Run once and then each module: you will see its settings, and on the last module โ€” the output you should get.

๐Ÿ“ค Example of the final output
{
  "number": "10442",
  "total": 3540
}

๐ŸŽฌ Stuck? To the guided solution with a click simulation โ†’

๐Ÿ’ก Hints (try without them first)
  • Apps like PDF.co or the Make AI Toolkit / AI for extraction. In a fixed format: PDF to text โ†’ regex.

Gmail โ†’ Iterator (attachments) โ†’ Filter mimeType = application/pdf โ†’ a conversion service (PDF.co โ†’ PDF to Text) โ†’ Text parser Match pattern โ†’ Sheets Add a Row. If the suppliers' format varies โ€” session 9 (AI).

๐ŸŽฌ The guided solution โ€” a click simulation

๐Ÿ“ธ The illustrated guide โ€” step by step, click by click

For every step: a screenshot of the (simulated) Make editor with the click spot marked, and below it exactly what to click and what to type. You can work from here next to an open Make window.

  1. 1
    Emails with files
    Gmail Watch emails with the criterion has:attachment.
    Marked screenshot โ€” step 1: Emails with files
    ๐Ÿ“ธ Step 1.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 1: Emails with files
    ๐Ÿ“ธ Step 1.2 โ€” the red ring marks where to click
    1. In the left menu click Scenarios โ†’ + Create a new scenario.
    2. Click the scenario name at the top left (New scenario) and type: C07 - PDF invoices.
    3. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    4. In the search box type Gmail and click the Gmail app.
    5. In the list of actions choose Watch emails.
    6. In the Criteria field type: from:supplier@acme.com has:attachment
    7. Click OK (or Save) to close the module window.
  2. 2
    Iterator over the files + PDF only
    Iterator over attachments โ†’ Filter mimeType = application/pdf.
    Marked screenshot โ€” step 2: Iterator over the files + PDF only
    ๐Ÿ“ธ Step 2.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 2: Iterator over the files + PDF only
    ๐Ÿ“ธ Step 2.2 โ€” the red ring marks where to click
    1. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    2. In the search box type Flow Control and click the Flow Control app.
    3. In the list of actions choose Iterator.
    4. In the Array field map (drag from the panel or type): {{1.attachments}}
    5. Click OK (or Save) to close the module window.
    6. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    7. In the search box type HTTP and click the HTTP app.
    8. In the list of actions choose Make a request.
    9. In the URL field type: https://api.pdf.co/v1/pdf/convert/to/text
    10. In the Method field choose: POST
    11. Click OK (or Save) to close the module window.
    12. Click the ๐Ÿ”ง icon on the line between the last two modules โ†’ Set up a filter.
    13. In the Label field type: PDF.
    14. In Condition set: 2.mimeType = application/pdf (pick the field from the panel, the operator from the list, and type a value).
    15. Click OK โ€” a funnel icon appears on the line.
  3. 3
    Extract with regex
    Text parser โ†’ Match pattern with number and total groups.
    Marked screenshot โ€” step 3: Extract with regex
    ๐Ÿ“ธ Step 3 โ€” the red ring marks where to click
    1. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    2. In the search box type Text parser and click the Text parser app.
    3. In the list of actions choose Match pattern.
    4. In the Pattern field type: Invoice No\.?\s*(?<number>\d+)[\s\S]*?Total\s*(?<total>[\d,.]+)
    5. In the Text field map (drag from the panel or type): {{3.data.body}}
    6. Click OK (or Save) to close the module window.
  4. 4
    Save in the sheet
    Add a Row with the number and the total.
    Marked screenshot โ€” step 4: Save in the sheet
    ๐Ÿ“ธ Step 4.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 4: Save in the sheet
    ๐Ÿ“ธ Step 4.2 โ€” the red ring marks where to click
    1. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    2. In the search box type Google Sheets and click the Google Sheets app.
    3. In the list of actions choose Add a Row.
    4. In the number field map (drag from the panel or type): {{4.number}}
    5. In the total field map (drag from the panel or type): {{parseNumber(4.total; ".")}}
    6. Click OK (or Save) to close the module window.
    7. Click โ–ถ Run once at the bottom left.
    8. When the run ends, bubbles with numbers appear above the modules. Click the bubble of the last module and check the Output.
    9. The output should look roughly like this:
      {
       "number": "10442",
       "total": 3540
      }

Boss challenge: Comparing with last year + an anomaly alert

๐Ÿ‘‘ Boss challengeโฑ๏ธ ~60 min

๐ŸŽฌ The scenario

If sales are 20% lower than the same week last year โ€” a special alert.

๐ŸŽฏ The requirements

  1. Compute last year's date range.
  2. A filter on the percent change.
  3. A separate alert route.

๐ŸŽฏ The desired result โ€” how the scenario should look and work

Click Run once and then each module: you will see its settings, and on the last module โ€” the output you should get.

๐Ÿ“ค Example of the final output
{
  "yoy": -23.4,
  "alert": true
}

๐ŸŽฌ Stuck? To the guided solution with a click simulation โ†’

๐Ÿ’ก Hints (try without them first)
  • addDays(now; -364) keeps the same day of the week.

A third search with the range addDays(now;-371)โ€“addDays(now;-364) โ†’ aggregator โ†’ yoy = (total-ly)/ly*100 โ†’ Router: yoy โ‰ค โˆ’20 โ†’ Telegram ๐Ÿšจ to the CEO.

๐ŸŽฌ The guided solution โ€” a click simulation

๐Ÿ“ธ The illustrated guide โ€” step by step, click by click

For every step: a screenshot of the (simulated) Make editor with the click spot marked, and below it exactly what to click and what to type. You can work from here next to an open Make window.

  1. 1
    This week's total
    Search + Numeric aggregator (Sum).
    Marked screenshot โ€” step 1: This week's total
    ๐Ÿ“ธ Step 1.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 1: This week's total
    ๐Ÿ“ธ Step 1.2 โ€” the red ring marks where to click
    1. In the left menu click Scenarios โ†’ + Create a new scenario.
    2. Click the scenario name at the top left (New scenario) and type: C07 - Year over year.
    3. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    4. In the search box type Google Sheets and click the Google Sheets app.
    5. In the list of actions choose Search Rows.
    6. In the Filter field map (drag from the panel or type): date โ‰ฅ {{addDays(now; -7)}}
    7. Click OK (or Save) to close the module window.
    8. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    9. In the search box type Tools and click the Tools app.
    10. In the list of actions choose Numeric aggregator.
    11. In the Function field type: SUM
    12. In the Value field map (drag from the panel or type): {{1.amount}}
    13. Click OK (or Save) to close the module window.
  2. 2
    The same week last year
    A third search from addDays(now; -371) to addDays(now; -364).
    Marked screenshot โ€” step 2: The same week last year
    ๐Ÿ“ธ Step 2.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 2: The same week last year
    ๐Ÿ“ธ Step 2.2 โ€” the red ring marks where to click
    1. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    2. In the search box type Google Sheets and click the Google Sheets app.
    3. In the list of actions choose Search Rows.
    4. In the Filter field map (drag from the panel or type): date between {{addDays(now; -371)}} and {{addDays(now; -364)}}
    5. Click OK (or Save) to close the module window.
    6. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    7. In the search box type Tools and click the Tools app.
    8. In the list of actions choose Numeric aggregator.
    9. In the Function field type: SUM
    10. In the Value field map (drag from the panel or type): {{3.amount}}
    11. Click OK (or Save) to close the module window.
  3. 3
    The percent change
    yoy = (this year โˆ’ last year) / last year ร— 100.
    Marked screenshot โ€” step 3: The percent change
    ๐Ÿ“ธ Step 3 โ€” the red ring marks where to click
    1. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    2. In the search box type Tools and click the Tools app.
    3. In the list of actions choose Set variable.
    4. In the Variable name field type: yoy
    5. In the Variable value field map (drag from the panel or type): {{round((2.result - 4.result) / 4.result * 100; 1)}}
    6. Click OK (or Save) to close the module window.
  4. 4
    An alert route
    Router: yoy โ‰ค โˆ’20 โ†’ Telegram ๐Ÿšจ.
    Marked screenshot โ€” step 4: An alert route
    ๐Ÿ“ธ Step 4.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 4: An alert route
    ๐Ÿ“ธ Step 4.2 โ€” the red ring marks where to click
    1. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    2. In the search box type Flow Control and click the Flow Control app.
    3. In the list of actions choose Router.
    4. Keep the defaults.
    5. Click OK (or Save) to close the module window.
    6. Click the small + coming out of the Router (to its right) to open a new route.
    7. In the search box type Telegram Bot and click the Telegram Bot app.
    8. In the list of actions choose Send a Text Message or a Reply.
    9. In the Text field map (drag from the panel or type): ๐Ÿšจ Sales are down {{5.yoy}}% from last year
    10. Click OK (or Save) to close the module window.
    11. Click the ๐Ÿ”ง icon on the line between the last two modules โ†’ Set up a filter.
    12. In the Label field type: Drop โ‰ฅ 20%.
    13. In Condition set: 5.yoy โ‰ค -20 (pick the field from the panel, the operator from the list, and type a value).
    14. Click OK โ€” a funnel icon appears on the line.
    15. Click โ–ถ Run once at the bottom left.
    16. When the run ends, bubbles with numbers appear above the modules. Click the bubble of the last module and check the Output.
    17. The output should look roughly like this:
      {
       "yoy": -23.4,
       "alert": true
      }