Issue with Dynamic Notifications

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • noob
    Junior Member
    • Jul 2025
    • 20

    #1

    Issue with Dynamic Notifications

    Hi everyone,

    I’m working on an EspoCRM project to automatically send internal notifications
    Context:
    • BPM Flowchart setup:
      1. Start Conditional → After Record Created
      2. Execute Formula Script to generate variables: $$title, $$date, $$assignee
      3. Create Notification to send the notification to the assigned user (assignedUser)
    • Goal: the notification should dynamically include:
      • Meeting name
      • Date/time
      • Assigned sales rep
      • Related contacts / leads
      • Objective and internal notes

    Execute Formula Script used

    // Minimal test to fetch some fields
    $$title = bpm\targetEntity\attribute('name');
    $$date = bpm\targetEntity\attribute('dateStart');
    $$assignee = bpm\targetEntity\attribute('assignedUserName');
    Internal Notification Template

    New meeting: {$$title}
    Scheduled date: {$$date} A
    ssigned to: {$$assignee}

    Current result:
    • Notifications are successfully created and sent, but the content still shows raw placeholders:
    • No dynamic values are being replaced.

    What I tried / Observations
    • Using {entity.xxx} directly in the template → not interpreted
    • Using {$$var} from the Formula Script → not interpreted in Create Notification
    • Minimal scripts → notification still shows raw placeholders
    • Complex scripts for contacts/leads → Execute Formula Script fails

    What I’m looking for
    • A way to make internal notifications dynamic with real values from the Meeting record.

    If anyone has successfully made dynamic variables work in internal notifications via BPM, I’d greatly appreciate your guidance.

    Thanks in advance for your advice and shared experiences!
  • lazovic
    Super Moderator
    • Jan 2022
    • 1145

    #2
    Hi noob,

    Please try to use the Script Task element instead of the Task one with the following formula script:
    Code:
    $title = bpm\targetEntity\attribute('name');
    $date = bpm\targetEntity\attribute('dateStart');
    $assignee = bpm\targetEntity\attribute('assignedUserName');
    More about the Script Task element you can find here: https://docs.espocrm.com/administrat...s/#script-task.

    Comment

    Working...