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

In one sentence

Students build real business logic: filters, a Router, data cleaning, dates and lead scoring โ€” on a live form.

Preparation before the session

Time plan

  1. 00:00โ€“00:15 Review: the bots we built
  2. 00:15โ€“00:45 Filters: operator types and complex conditions
  3. 00:45โ€“01:15 Router and the fallback route
  4. 01:15โ€“01:30 โ˜• Break
  5. 01:30โ€“01:55 Cleaning data: text functions and regex
  6. 01:55โ€“02:15 Dates, time zones and switch
  7. 02:15โ€“02:50 Building together: a smart lead form
  8. 02:50โ€“03:00 Summary and practice

Lecture parts and activity type

PartActivity type
Filters โ€” the gate between two modulesExplanation + demo
Router โ€” splitting into routesDemo + simulation
Cleaning and normalizing dataPlayground
Dates and time zonesPlayground
if, ifempty and switchExplanation
Lead scoringBuilding together
Building together: a smart lead formBuilding together

The 3 messages that must get across

  1. An early filter = economical Credits.
  2. A Router without overlaps + a fallback.
  3. UTC inside, the local time zone outside.

Questions for class discussion

  • Which criteria would you put in a scoring model for your business?
  • What's the price of a hot lead that waits an hour?
  • When is it better not to route automatically and let a person decide?

Live demo script

First filters

  1. A sample lead โ€” Tools โ†’ Set multiple variables: name, email, budget=45000.
  2. A second module โ€” Tools โ†’ Compose a string: Relevant lead: {{1.name}}.
  3. Filter โ€” Click the line โ†’ Label: High budget โ†’ {{parseNumber(1.budget)}} Numeric: Greater than 20000 โ†’ Add AND rule โ†’ email Basic: Exists.
  4. Test โ€” Run once โ†’ you see a bubble. Change to 5000 โ†’ Run once โ†’ a bubble only on module 1.

Clean and normalize a lead

  1. Input โ€” Set multiple variables with the dirty lead from the lecture.
  2. name / email โ€” {{trim(1.name)}}, {{lower(trim(1.email))}}.
  3. phone โ€” {{"+972" + substring(replace(1.phone; "/[^0-9]/g"; emptystring); 1; 10)}}.
  4. domain โ€” {{last(split(lower(trim(1.email)); "@"))}}.
  5. isBusiness โ€” {{if(contains(domain; "gmail") or contains(domain; "walla") or contains(domain; "yahoo") or contains(domain; "hotmail"); false; true)}}.

A live lead form with a webhook

  1. Webhook โ€” Webhooks โ†’ Custom webhook โ†’ Add โ†’ copy the address.
  2. Tally โ€” Integrations โ†’ Webhooks โ†’ paste โ†’ Connect.
  3. Learn the structure โ€” Make: Run once โ†’ submit the form โ†’ Successfully determined.
  4. Filter โ€” Email Matches pattern ^[^@\s]+@[^@\s]+\.[^@\s]+$.
  5. Clean-up + score โ€” Set multiple variables with the formula from the lecture.
  6. Activation โ€” Scheduling: Immediately โ†’ ON.

Problems students will run into

ProblemQuick fix
The filter always failsA Text comparison instead of Numeric โ€” "45000" > "20000" as text may fail.
I can't find Set up a filterClick exactly on the line (or on the wrench icon in its middle).
phone came out +97250123456 (a digit missing)substring(โ€ฆ; 1; 10) โ€” the end is 10 (exclusive). Check that the source is 10 digits long.
emptystring isn't recognizedPick it from the General tab in the panel, don't type it.
The webhook receives nothingCheck that the scenario is in Run once or ON, and that the address in Tally is complete.
The fields don't appearRedetermine data structure and submit another form.
score is always 5budget arrives as text โ€” parseNumber, or the field is empty โ€” ifempty(โ€ฆ; 0).
A lead got two messagesOverlapping ranges โ€” check โ‰ฅ50 AND <80.
The fallback always runsIt's set up as a normal route with an empty filter. Tick Fallback route: Yes.

Tips from the classroom

  • Tally with a raw webhook is confusing โ€” also show the Tally app.
  • Let students "break" the Router on purpose with overlapping ranges.
  • A label on every filter โ€” insist on it.

Adapting to different levels

For students who struggle: Work on static data without a form.

For fast students: The business-hours challenge + duplicate detection.

Answer key โ€” multiple-choice questions

Students see the answers in shuffled order, so the key gives the wording of the right answer.

#Right answer
1On the line between two modules
2On both routes
3UTC
4private
5Matches pattern
60
7formatDate(d; "DD/MM/YYYY HH:mm"; "Asia/Jerusalem")
8Modules that don't run don't use Credits

Homework

  1. The form should work end to end with 3 test leads.
  2. Preparing for session 4: install Postman (or use hoppscotch.io in the browser) โ€” we will send requests to a webhook.