Session 3 of 15
Functions and Business Logic โ Filters, Router and Dates
How to make a scenario "think": filters that stop irrelevant data, a Router that splits into routes, text and date functions, and lead scoring โ all without code.
โฑ๏ธ 3 hours๐ ๏ธ A smart lead form with scoring and routing (Webhook โ Filter โ Score โ Router โ Telegram)
๐ฏ Session goals
- Add filters with different kinds of conditions (text, number, date, existence).
- Build a Router with several routes and a fallback route.
- Clean and normalize data with text functions (trim, lower, replace, regex).
- Work with dates and time zones: parseDate, formatDate, addDays.
- Use if, ifempty and switch to compute values.
- Build a simple lead-scoring model.
- Connect a form (Tally) to Make with a webhook and route leads by score.
๐งช Today's scenario โ a live run
๐๏ธ The agenda
- 00:00โ00:15 Review: the bots we built
- 00:15โ00:45 Filters: operator types and complex conditions
- 00:45โ01:15 Router and the fallback route
- 01:15โ01:30 โ Break
- 01:30โ01:55 Cleaning data: text functions and regex
- 01:55โ02:15 Dates, time zones and switch
- 02:15โ02:50 Building together: a smart lead form
- 02:50โ03:00 Summary and practice
Filters โ the gate between two modules
- A filter on the line between modules
- Operators: Basic, Text, Numeric, Date, Array
- AND / OR
- An early filter = saving Credits
Router โ splitting into routes
- Router = the same bundle to several routes
- Routes run in order
- Fallback route = if none matched
- Ranges that don't overlap
Cleaning and normalizing data
- trim, lower, replace
- Regex: /[^0-9]/g to clean a phone
- split + last for the domain
- Matches pattern in a filter
Dates and time zones
- Make stores in UTC
- formatDate with a time zone
- parseDate with a pattern
- addDays / addHours
if, ifempty and switch
- if for a simple condition
- ifempty for a default
- switch for a multiple choice
- and / or inside if
Lead scoring
- A 0โ100 score by criteria
- Nested if + switch
- A business email = points
- One Set variable for the score
Building together: a smart lead form
- Custom webhook โ address
- Tally Integrations โ webhook
- Redetermine data structure
- Email filter โ clean-up + score โ Router
โ๏ธ Understanding check
๐ To sum up
- A filter on the line stops irrelevant bundles โ and saves Credits.
- A Router splits into routes; the fallback runs when no route matched.
- Clean data with trim, lower, replace and regex.
- Dates are in UTC โ always formatDate with a time zone.
- We built a lead form with scoring and routing to Telegram.
๐๏ธ Time to practice!
The session project: A smart lead form with scoring and routing (Webhook โ Filter โ Score โ Router โ Telegram)