Custom Component Dispatch Event now-ui.json setup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
15 hours ago
Hi,
I'm trying to dispatch an event from a custom component to open a record on click.
In my first try I successfully dispatched an event, but I couldn't configure the response in the UI Builder, as I only saw undefined in the payload.
So now I searched around and checked some other tutorials, but I couldn't get it to work.
Currently it looks like this:
"actions": [
{
"action": "CARD_HEADER_CLICKED",
"label": "Card header clicked",
"description": "Open form of clicked card",
"payload": [
{
"name": "id",
"label": "SysID",
"description": "SysID of record represented by clicked card",
"defautlValue": ""
}
]
}
]
But this is showing up as invalid when I try to deploy it.
I can't figure out the issue looking at the documentation.
Can somebody provide me some pointer to where I could look to resolve this?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
15 hours ago
defautlValue
already changed to
defaultValue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
13 hours ago
Hi @GGriessler
The issue is with your JSON definition, specifically the "payload" section of your action definition.
There are two problems:
-
Typo: You wrote "defautlValue" instead of "defaultValue".
-
Structure mismatch: The payload should define type and defaultValue, not just name and description.
That’s why UI Builder flags it as invalid during deployment.
"actions": [
{
"action": "CARD_HEADER_CLICKED",
"label": "Card header clicked",
"description": "Open form of clicked card",
"payload": [
{
"name": "id",
"label": "Sys ID",
"description": "Sys ID of the record represented by clicked card",
"type": "string",
"defaultValue": ""
}
]
}
]
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/