I have a Select component that used to work with with this code in the Change EventHandler. It broke after the update to the new control version. Now I get "Cannot read properties of null (reading 'actions')".
{{
macroSelect.value.actions.find(i => i.field == "comment_value_html") != null ? macroSelect.value.actions.find(i => i.field == "comment_value_html").value :
macroSelect.value.actions.find(i => i.field == "comment_value").value[0] == "channel:all" ? macroSelect.value.actions.find(i => i.field == "comment_value").value[1]: macroSelect.value.actions.find(i => i.field == "comment_value").value
}}
The source is from the butt-ugly Zendesk API. What I want to grab is "ARTICLE TEXT".
{
"macros": [
{
"id": 6898,
"title": "My TITLE",
"active": true,
"actions": [
{
"field": "status",
"value": "solved"
},
{
"field": "group_id",
"value": "current_groups"
},
{
"field": "assignee_id",
"value": "current_user"
},
{
"field": "comment_mode_is_public",
"value": "true"
},
{
"field": "comment_value",
"value": [
"channel:all",
"ARTICLE TEXT"
]
}
],
"restriction": null
},
The ReTool javascript editor does not show what functions are available after macroSelect.value. Can you help me identify what needs to be changed?
Thanks,
Francis