Session 2 / 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: A currency report with a trend

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

๐ŸŽฌ The scenario

Add a trend to the report: did the dollar go up or down compared with a week ago, and by what percentage.

๐ŸŽฏ The requirements

  1. Another call to Frankfurter with the date of 7 days ago.
  2. Calculate the percent change.
  3. An arrow ๐Ÿ“ˆ/๐Ÿ“‰ by the direction.

๐ŸŽฏ 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
{
  "pct": 0.81,
  "text": "๐Ÿ’ต Dollar: 3.72 ILS ๐Ÿ“ˆ 0.81% vs a week ago"
}

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

๐Ÿ’ก Hints (try without them first)
  • formatDate(addDays(now; -7); "YYYY-MM-DD") inside the URL.
  • Percent = (new โˆ’ old) รท old ร— 100.
  1. HTTP 2: https://api.frankfurter.app/{{formatDate(addDays(now; -7); "YYYY-MM-DD")}}?from=USD&to=ILS.
  2. Set variable: pct = {{round((1.data.rates.ILS - 2.data.rates.ILS) / 2.data.rates.ILS * 100; 2)}}.
  3. In the text: {{if(pct >= 0; "๐Ÿ“ˆ"; "๐Ÿ“‰")}} {{pct}}%.

๐ŸŽฌ 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
    Today's rate
    HTTP to Frankfurter with the latest rate.
    Marked screenshot โ€” step 1: Today's rate
    ๐Ÿ“ธ Step 1.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 1: Today's rate
    ๐Ÿ“ธ 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: C02 - Dollar trend.
    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 HTTP and click the HTTP app.
    5. In the list of actions choose Make a request.
    6. In the URL field type: https://api.frankfurter.app/latest?from=USD&to=ILS
    7. In the Parse response field choose: Yes
    8. Click OK (or Save) to close the module window.
  2. 2
    The rate a week ago
    A second HTTP with a computed date: addDays(now; -7).
    Marked screenshot โ€” step 2: The rate a week ago
    ๐Ÿ“ธ 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 HTTP and click the HTTP app.
    3. In the list of actions choose Make a request.
    4. In the URL field map (drag from the panel or type): https://api.frankfurter.app/{{formatDate(addDays(now; -7); "YYYY-MM-DD")}}?from=USD&to=ILS
    5. In the Parse response field choose: Yes
    6. Click OK (or Save) to close the module window.
  3. 3
    Compute the percent change
    round((today โˆ’ then) / then ร— 100; 2).
    Marked screenshot โ€” step 3: Compute 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: pct
    5. In the Variable value field map (drag from the panel or type): {{round((1.data.rates.ILS - 2.data.rates.ILS) / 2.data.rates.ILS * 100; 2)}}
    6. Click OK (or Save) to close the module window.
  4. 4
    A message with a trend arrow
    if picks ๐Ÿ“ˆ or ๐Ÿ“‰ by the sign.
    Marked screenshot โ€” step 4: A message with a trend arrow
    ๐Ÿ“ธ Step 4 โ€” 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 Telegram Bot and click the Telegram Bot app.
    3. In the list of actions choose Send a Text Message or a Reply.
    4. In the Text field map (drag from the panel or type): ๐Ÿ’ต Dollar: {{1.data.rates.ILS}} ILS {{if(3.pct >= 0; "๐Ÿ“ˆ"; "๐Ÿ“‰")}} {{3.pct}}% vs a week ago
    5. Click OK (or Save) to close the module window.
  5. 5
    Run
    Check the percentage in the bubble.
    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:
      {
       "pct": 0.81,
       "text": "๐Ÿ’ต Dollar: 3.72 ILS ๐Ÿ“ˆ 0.81% vs a week ago"
      }

Experts: A report for several subscribers

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

๐ŸŽฌ The scenario

Three people want the report, each in a different currency (USD / EUR / GBP).

๐ŸŽฏ The requirements

  1. A subscriber list (Chat ID + currency) inside the scenario.
  2. A tailored message for each subscriber.
  3. Without duplicating modules.

๐ŸŽฏ 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
{
  "bundles": 3,
  "credits": 8
}

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

๐Ÿ’ก Hints (try without them first)
  • Set variable with an array of collections, then an Iterator.
  • Frankfurter with to=ILS and a dynamic from.
  1. Tools โ†’ Set variable: subs = an array (you can Parse JSON from text: [{"chat":111,"cur":"USD"},โ€ฆ]).
  2. Flow Control โ†’ Iterator over the array.
  3. HTTP: โ€ฆlatest?from={{2.cur}}&to=ILS.
  4. Telegram Send: Chat ID = {{2.chat}}.

3 subscribers ร— 2 modules = 6 Credits + 2 before the Iterator.

๐ŸŽฌ 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
    A subscriber list inside the scenario
    Parse JSON from fixed text โ€” an array of chat + cur.
    Marked screenshot โ€” step 1: A subscriber list inside the scenario
    ๐Ÿ“ธ Step 1.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 1: A subscriber list inside the scenario
    ๐Ÿ“ธ 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: C02 - Subscriber report.
    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 JSON and click the JSON app.
    5. In the list of actions choose Parse JSON.
    6. In the JSON string field type: [{"chat":111,"cur":"USD"},{"chat":222,"cur":"EUR"},{"chat":333,"cur":"GBP"}]
    7. Click OK (or Save) to close the module window.
  2. 2
    Iterator over the subscribers
    Each subscriber becomes a bundle.
    Marked screenshot โ€” step 2: Iterator over the subscribers
    ๐Ÿ“ธ 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 Iterator.
    4. In the Array field map (drag from the panel or type): {{1.array}}
    5. Click OK (or Save) to close the module window.
  3. 3
    A rate in the subscriber's currency
    The URL uses {{2.cur}}.
    Marked screenshot โ€” step 3: A rate in the subscriber's currency
    ๐Ÿ“ธ 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 HTTP and click the HTTP app.
    3. In the list of actions choose Make a request.
    4. In the URL field map (drag from the panel or type): https://api.frankfurter.app/latest?from={{2.cur}}&to=ILS
    5. In the Parse response field choose: Yes
    6. Click OK (or Save) to close the module window.
  4. 4
    A message to each subscriber
    The Chat ID is mapped from the subscriber โ€” without duplicating modules.
    Marked screenshot โ€” step 4: A message to each subscriber
    ๐Ÿ“ธ Step 4 โ€” 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 Telegram Bot and click the Telegram Bot app.
    3. In the list of actions choose Send a Text Message or a Reply.
    4. In the Chat ID field map (drag from the panel or type): {{2.chat}}
    5. In the Text field map (drag from the panel or type): {{2.cur}} today: {{3.data.rates.ILS}} ILS
    6. Click OK (or Save) to close the module window.
  5. 5
    Run and count the Credits
    3 subscribers ร— 2 modules + 2 before the Iterator = 8.
    Marked screenshot โ€” step 5: Run and count the Credits
    ๐Ÿ“ธ 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:
      {
       "bundles": 3,
       "credits": 8
      }

Boss challenge: A report only on a significant change

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

๐ŸŽฌ The scenario

Send an alert (every hour on trading days) only if the dollar moved by more than 1% since the last alert.

๐ŸŽฏ The requirements

  1. Keep the last rate between runs.
  2. A filter on the percent change.
  3. Update the stored value only when an alert was sent.

๐ŸŽฏ 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
{
  "rate": 3.76,
  "sent": true
}

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

๐Ÿ’ก Hints (try without them first)
  • A data store (a preview of session 8) โ€” Tools โ†’ Set/Get variable do not persist between runs!
  1. Data store fx_state (key: usd, field: rate).
  2. HTTP โ†’ Data store Get a record.
  3. Filter: abs(1.data.rates.ILS - 2.rate) / 2.rate * 100 > 1.
  4. Telegram Send โ†’ Data store Add/replace a record with the new rate.

๐ŸŽฌ 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
    A data store for the last rate
    fx_state with key = usd and a rate field.
    Marked screenshot โ€” step 1: A data store for the last rate
    ๐Ÿ“ธ Step 1.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 1: A data store for the last rate
    ๐Ÿ“ธ Step 1.2 โ€” the red ring marks where to click
    1. Open eu2.make.com/datastores in your browser (the โ€œData storesโ€ screen).
    2. On the screen you will see: Name: fx_state ยท rate (Number)
    3. Click the Save button.
    4. In the left menu click Scenarios โ†’ + Create a new scenario.
    5. Click the scenario name at the top left (New scenario) and type: C02 - 1% alert.
  2. 2
    Rate now + the stored rate
    HTTP followed by Get a record.
    Marked screenshot โ€” step 2: Rate now + the stored rate
    ๐Ÿ“ธ Step 2.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 2: Rate now + the stored rate
    ๐Ÿ“ธ 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 HTTP and click the HTTP app.
    3. In the list of actions choose Make a request.
    4. In the URL field type: https://api.frankfurter.app/latest?from=USD&to=ILS
    5. In the Parse response field choose: Yes
    6. Click OK (or Save) to close the module window.
    7. Click the + (the big circle in the middle, or the half-circle to the right of the last module).
    8. In the search box type Data store and click the Data store app.
    9. In the list of actions choose Get a record.
    10. In the Data store field type: fx_state
    11. In the Key field type: usd
    12. Click OK (or Save) to close the module window.
  3. 3
    A filter on the percent change
    Continue only if the change is bigger than 1%.
    Marked screenshot โ€” step 3: A filter on the percent change
    ๐Ÿ“ธ Step 3.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 3: A filter on the percent change
    ๐Ÿ“ธ Step 3.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 Telegram Bot and click the Telegram Bot app.
    3. In the list of actions choose Send a Text Message or a Reply.
    4. In the Text field map (drag from the panel or type): โš ๏ธ The dollar moved to {{1.data.rates.ILS}} ILS
    5. Click OK (or Save) to close the module window.
    6. Click the ๐Ÿ”ง icon on the line between the last two modules โ†’ Set up a filter.
    7. In the Label field type: Change > 1%.
    8. In Condition set: abs(1.data.rates.ILS - 2.rate) / 2.rate * 100 > 1 (pick the field from the panel, the operator from the list, and type a value).
    9. Click OK โ€” a funnel icon appears on the line.
  4. 4
    Update only after an alert
    Add/replace a record after Telegram โ€” so the rate is saved only when an alert was sent.
    Marked screenshot โ€” step 4: Update only after an alert
    ๐Ÿ“ธ Step 4 โ€” 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 Data store and click the Data store app.
    3. In the list of actions choose Add/replace a record.
    4. In the Key field type: usd
    5. In the rate field map (drag from the panel or type): {{1.data.rates.ILS}}
    6. Click OK (or Save) to close the module window.
  5. 5
    Hourly on trading days
    Every hour + Days: Monโ€“Fri.
    Marked screenshot โ€” step 5: Hourly on trading days
    ๐Ÿ“ธ Step 5.1 โ€” the red ring marks where to click
    Marked screenshot โ€” step 5: Hourly on trading days
    ๐Ÿ“ธ Step 5.2 โ€” the red ring marks where to click
    1. Click the clock ๐Ÿ•’ in the bottom bar (next to the ON/OFF switch).
    2. In the schedule settings choose: At regular intervals ยท 60 minutes ยท Monโ€“Fri and click OK.
    3. Click โ–ถ Run once at the bottom left.
    4. When the run ends, bubbles with numbers appear above the modules. Click the bubble of the last module and check the Output.
    5. The output should look roughly like this:
      {
       "rate": 3.76,
       "sent": true
      }
    6. Click ๐Ÿ’พ Save in the bottom bar (or Ctrl+S / โŒ˜+S).
    7. Switch the toggle OFF โ†’ ON in the bottom bar so the scenario runs on its schedule.