Skip to content

fix: JSONata $message variable refs inside ~{} expressions always resolve to undefined #161

Description

@droarty

Problem

Inside ~{ ... } blocks in workflow JSON configs, expressions are evaluated via JSONata's expr.evaluate(context). In JSONata, $identifier is a bound variable, not a path. Since no variable named $message is ever bound, $message is always undefined inside JSONata:

  • user-dashboard.json: $count($message.groups) = 0$count(undefined) = 00 = 0 → always true → "no groups" message always shows even when user has groups
  • group-dashboard.json: $message.id = 'manage-documents'undefined = '...' → always false → wrong right-panel text in admin panel

The correct JSONata path syntax for context.message.groups is message.groups (no $ prefix), since context is the root input $.

Fix

  • user-dashboard.json: $count($message.groups)$count(message.groups)
  • group-dashboard.json: $message.idmessage.id in the open-admin-panel handler

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions