Skip to content
ModuleM9 — Make it work by itself
After this session you canMake your application notify the right person automatically, and prove that it does.
TimeFacilitated: 23 min · On your own: 23 min
Before you startM6-S1: Assigned To is a User field. M8-S1: Omar can open Team Tasks. Yourself and Omar signed in, in two windows.
Go deeperNotify the assignee · Reactions and automation

◆ Orientation (1 min) — The last of the five questions you build

Section titled “◆ Orientation (1 min) — The last of the five questions you build”

You have answered need, data and people in your application. This session answers automation: what should happen by itself? For Team Tasks the answer from the plan is one thing: when a task is created, the person it is assigned to is told at once.

That one notification is what turns a list into a working system: nobody has to remember to tell the assignee, and nobody can forget.

▤ Concept (3 min) — Event, filter, action

Section titled “▤ Concept (3 min) — Event, filter, action”

A reaction is a rule that runs by itself, built in three parts:

PartQuestion it answersFor Team Tasks
EventWhen does it run?On Entry Created: whenever a task is saved as a new record
Filter (optional)Only if…Left empty, so it runs for every new task
ActionDo what?Send Notification, In App, to the person in Assigned To

The screen calls the middle part Filter; you may also read it called a condition. A reaction does one thing: to send an email as well, you would add a second reaction on the same event.

flowchart LR
  E["Event: On Entry Created"] --> F{"Filter: empty, so always"}
  F --> A["Action: Send Notification, In App"]
  A --> R["Recipient: the user in Assigned To"]

What to notice: the recipient is not a fixed person. It is read from each task’s Assigned To field, which is why that field had to be of the User type.

A notification’s Title can carry a placeholder in double braces, such as New task: {{task}}. As soon as you type it, a row for task appears under Custom Variables, and there you connect the placeholder to a field: here task is mapped to Title, so Omar reads New task: Prepare the budget.

If you assign a test task to yourself and get the notification, you have not proved much: a reaction that always notified you, whoever the assignee was, would pass the same test. Assign the task to Omar and check in Omar’s window: only then do you know the recipient comes from the field. If nothing arrives, the reaction’s list on the Reactions tab shows whether it ran.

With a facilitator. The facilitator plays the video, or builds the reaction live and proves it with a second account, before everyone starts the lab.

On your own. Watch the video once before you start. The lab below gives every step in writing, so you can also go straight to it without the video.

Notify the assignee: the opening frame of the video. Follow the link to watch it.

Tutorial · Part 3 of 3 · 2 min

Notify the assignee

A reaction tells each person when a task is assigned to them · Recorded on Osos 1.11.0-alpha.1

What to notice: the three parts of a reaction, in order: the event On Entry Created; the action Send Notification, in the app, whose title holds a placeholder mapped to the Title field under Custom Variables; and Recipients taken from the Assigned To field, not a fixed person. Then the proof: a test task is assigned to someone else, and that person’s own bell shows it. The video’s second person is Karim, where yours is Omar, and it sets Execution Spaces to the root space; in the lab, leave Execution Spaces at its default.

Goal. Build the Notify assignee reaction and prove, with Omar’s account, that it notifies the person in Assigned To.

Before you start. Yourself and Omar signed in, in two windows.

Build the reaction

  1. Open Administration › Applications › Modules › Task Management, open the Tasks entity and select the Reactions tab.
  2. Select + (or Add Reaction if the list is empty). The New Reaction dialog opens.
  3. Enter the Name Notify assignee.
  4. Under Event, choose On Entry Created. Leave the other event settings (Event Source Type, Execution Spaces, Event Executor Type) as they are. Leave Filter empty.
  5. Under Action, set Action Type to Send Notification. Enter the action’s Name Send notification and set Channel Type to In App.
  6. Enter the Title New task: {{task}} and the Content You have a new task. Open it from Team Tasks. As you finish typing {{task}}, a row for it appears under Custom Variables.
  7. In that row (columns Variable, Type, Map to and Redact in history), set Type to Field. Map to becomes a tree of fields: open Entry Fields and select Title.
  8. Under Recipients, set Source to User, Type to Field and Value to Assigned To. Select Save. Notify assignee appears in the list.

The notification settings of the new reaction: Channel Type In App, Title New task: {{task}}, the variable task mapped to Title, and Recipients taken from the Assigned To field What to notice: Recipients is set to a field, not to a person. Each task’s own Assigned To decides who is told.

Prove it with two accounts

  1. In your own window, open Team Tasks and select Add Task. Enter the Title Prepare the budget, set Assigned To to Omar Faris, pick a Due Date from the calendar, and select Save.
  2. In Omar’s window, look at the bell: it shows New task: Prepare the budget. Select it: the task opens.

Omar's notification panel under the bell, showing New task: Prepare the budget What to notice: the title came from the task itself, through the task placeholder. Omar gets it without reloading.

Check.

  • Notify assignee is listed on the Tasks entity’s Reactions tab.
  • Its event is On Entry Created, and its recipients come from the Assigned To field.
  • Omar received New task: Prepare the budget under his bell.
  • Selecting the notification opened the task.

Pass condition. A task you create and assign to Omar produces, in Omar’s window, a notification whose title names that task.

If something goes wrong

What you seeWhat to do
Nothing under Omar’s bellOpen Notify assignee from the Reactions tab: the list shows whether it ran. Check that Recipients reads User › Field › Assigned To.
The notification reads New task: {{task}}The placeholder is not mapped. Under Custom Variables, map task to the field Title.
There is no task row under Custom VariablesThe row appears only once {{task}} is typed in Title, with both pairs of braces. Check the spelling.
You received the notification instead of OmarRecipients points at a fixed person. Set Type to Field and Value to Assigned To.
The notification arrives, but the task does not open for OmarOmar cannot open Team Tasks: repeat the last part of M8-S1.
You saved the task as a draftDrafts run no automation (Module 4). Finish the draft and save it as a real task.
Model answer

The finished reaction, read as a sentence: when a task is created (event), always (no filter), send an in-app notification (action) titled “New task: ” plus the task’s title, to the user in the task’s Assigned To field (recipient). The two-account test passes only if the recipient really comes from the field: assigning to Omar and seeing it in Omar’s window rules out a recipient fixed to you.

✓ Practice (4 min) — Check your understanding

Section titled “✓ Practice (4 min) — Check your understanding”
PracticeChoose one answer.

A builder wants a notification only when a new task is created with the Status Completed (tasks logged after the fact). Which part of the reaction changes?

  1. Explanation for A

    ✗ Incorrect

    The moment is still the creation of a task. What changes is the extra condition on which new tasks qualify. See The shape of every reaction.

  2. Explanation for B

    ✓ Correct

    The filter narrows which events trigger the action, so only completed new tasks qualify. See The shape of every reaction.

  3. Explanation for C

    ✗ Incorrect

    Recipients decide who is told, not when the reaction runs. See The shape of every reaction.

Check your answer

The correct answer is B. Open the explanation under each option to see why.

PracticeChoose one answer.

A learner tests the reaction by assigning a task to themselves and receives the notification. Why is that test not enough?

  1. Explanation for A

    ✓ Correct

    The test cannot tell “the person in Assigned To” from “always me”. Assigning to a colleague can. See Why you test with two accounts.

  2. Explanation for B

    ✗ Incorrect

    Drafts run no automation at all, so a draft would prove nothing. The test needs a real task assigned to someone else. See Why you test with two accounts.

  3. Explanation for C

    ✗ Incorrect

    This reaction sends an in-app notification only; an email would be a second reaction. See The shape of every reaction.

Check your answer

The correct answer is A. Open the explanation under each option to see why.

PracticeDecide whether the statement is true or false.

One reaction can send both an in-app notification and an email.

  1. Explanation for A

    ✗ Incorrect

    A reaction does one thing. For an email as well, you add a second reaction on the same event. See The shape of every reaction.

  2. Explanation for B

    ✓ Correct

    Each reaction has one action, so the notification and the email are two reactions on the same event. See The shape of every reaction.

Check your answer

The correct answer is B (False). Open the explanation under each option to see why.

You built your first automation and proved it the reliable way. You can read any reaction as event, filter, action, and you know why the recipient must come from a field and why the test needs a second person.

Next. Every piece of Team Tasks is in place. In Module 10, the capstone, you run the whole application end to end, with Omar on the phone, and collect the evidence for your certification.