Skip to content

$item in action.params returns path string instead of value (0.19.0, React) #292

Description

@Mjingling

Hi @ctate :

I noticed a small inconsistency when using { "$item": "field" } inside action.params within a repeated element. It currently returns a JSON path string (e.g., "list/0/url") rather than the actual field value. In contrast, { "$bindItem": "url" } works as expected.

We would be very grateful if you could take a look at this. 🙏

Works correctly: { "$bindItem": "url" } → actual value
Observed issue: { "$item": "url" } → "list/0/url"

Schema snippet

"task-card": {
  "type": "Card",
  "on": {
    "click": {
      "action": "openLink",
      "params": {
        "url": { "$item": "url" }   // ❌ becomes "list/0/url"
      }
    }
  }
}

Steps to reproduce
State has list with items containing url.

Use repeat on /list.

Inside repeated element, add action with params: { url: { "$item": "url" } }.

Trigger action → parameter is "list/0/url", not the actual URL.

Change to $bindItem → works correctly.

Expected vs actual
Expected: { "$item": "url" } → actual URL string

Actual: → path string like "list/0/url"

Environment
json-render: 0.19.0

Framework: React

Workaround
Use { "$bindItem": "url" } instead of $item inside action params.

We would really appreciate it if this could be fixed. Thank you!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions