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

The bottom line (TL;DR)

  • A bundle is a collection of fields; an array inside a bundle is not several bundles.
  • Drag fields in the mapping panel and combine functions; arrays start at 1.
  • Connections store keys securely โ€” never in a text field.
  • Polling uses Credits even with no data; instant only when there is an event.
  • We built a Telegram bot that sends a morning report.

The key points โ€” in depth

1. Bundle, Collection, Array

A bundle is a collection. An array inside it stays one bundle until you break it up with an Iterator.

2. Data types

Text, Number, Date, Boolean, Array, Collection, Binary. Make checks types, and you use parseNumber/parseDate to convert.

3. The mapping panel

Tabs of modules and functions. Drag, don't type. Run this module only to fill the panel.

4. Parse JSON and data structures

From JSON text to fields; a data structure defines a structure in advance.

5. Connections

OAuth, API key, Basic, Keychain. Clear names, Verify, and preferably a service account.

6. Scheduling

Instant vs. polling; every polling check = a Credit. Limit and starting point.

7. Scenario settings

Sequential processing, incomplete executions, Data is confidential, consecutive errors.

Concept cards (click or press Enter to flip)

Collection
An object with named fields (for example rates.ILS).
Array
A list; the index starts at 1.
Polling trigger
A trigger that checks every X minutes โ€” every check uses a Credit.
Instant trigger
A trigger that receives an event immediately (webhook).
Parse JSON
Turns JSON text into fields.
Data structure
A template that defines fields and types.
Chat ID
The ID of the Telegram chat the bot sends to.
Data is confidential
A setting that prevents saving content in History.

Spaced repetition โ€” the session concepts

Mark "I knew it" or "Not yet" โ€” the cards you did not know come back more often. Cards from all the sessions are in the arcade.

Quick cheat sheet

WhatDetails
{{1.rates.ILS}}A nested field
{{first(arr)}} / {{arr[1]}}The first item
{{round(x; 2)}}Round to 2 digits
{{parseNumber(t; ".")}}Text โ†’ number
{{addDays(now; -7)}}A week ago
Telegram Bot โ†’ Send a Text MessageSend a message; Parse mode HTML
JSON โ†’ Parse JSONText โ†’ fields
Run this module onlyRun a single module to test

Common mistakes to avoid

  • Thinking that an array inside a bundle makes the next module run several times.
  • Pasting a token or an API key into a URL or text.
  • Leaving polling every 15 minutes on a scenario that needs to run once a day.
  • Forgetting to send the bot a message before Watch Updates.
  • Unclosed HTML in Telegram โ€” the message is rejected.

Self-review questions

  1. What's the difference between Search rows returning 5 results and HTTP returning an array of 5?
  2. Why is polling more expensive than instant?
  3. When would you use Data is confidential?
  4. What does a data structure do and why is it useful?
  5. How do you find a group's Chat ID?

Homework and preparing for the next session

  1. Complete the practice tasks โ€” the bot should send a report tomorrow morning.
  2. Preparing for session 3: open a free account on Tally (tally.so) โ€” we will build a lead form.