Commands
Commands
Commands are bound to toolbars, defining menu actions and their execution logic. Each toolbar menu item specifies which service to execute or what action to perform, such as opening a form in a modal, adding a new object, or deleting a selected row. Commands include a settings configuration where you can define the related service and refresh behavior based on the use case.
"commands": {
"csvExport" : {
"type": "export",
"label": "CSV Export",
"settings": {
"columns": ["title", "description"],
"excludeHiddenColumn": true
}
},
"createNewCR" : {
"type": "genericService",
"label": "Create Change Request",
"isMenu": false,
"settings": {
"relatedConfig": {
"services": [
{
"name": "CreateChangeRequest"
}
],
"useSavedContextId":true,
"refreshBehavior": "removeRow"
}
}
},
}
Command properties
| Prop Name | Description | Data Type | Required | Example |
|---|---|---|---|---|
name | Unique identifier for the command. | string | yes | "createIssue" |
label | Display text for the command in the UI. | string | yes | "Create Issue" |
type | Command type (e.g., form 1) launchFormAsModal this is used to popup form with data.genericService without form perform action behind service call trigger. | string | no | "launchFormAsModal" |
settings | Configuration specific to the command type. | object | no | {"config": {"type": "form", "id": "createNewIssue"}} or {"relatedConfig": {"name": "CreateChangeRequest"}} |
isMenu | Displays as a menu if true. Defaults to false if omitted. | boolean | no | false |
Command settings properties
Below sub elements define how command settings should be configured
| Property Name | Description | Data Type | Required | Example |
|---|---|---|---|---|
refreshBehavior | Defines how the UI refreshes after execution. Possible values: refreshRow — refreshes the selected row from graph data. refreshParents — refreshes parent rows. refreshRowWithColumnService — refreshes the row using a column-specific service (network call). expandRowWithService — expands the row using a service. removeRow — removes the selected row. Ignored when responseMapping is defined. | string | no | "refreshRow" |
relatedConfig | Defines the service to call and how to refresh the row after execution. | object | no | |
responseMapping | Maps fields from the service response directly to graph node attributes, triggering an instant row re-render without an extra network call. Single object { expression, attribute } or an array for multiple mappings. See responseMapping below. | object or array | no | { "expression": "results[0].maturityState", "attribute": "state" } |
service | Controls if to select data from nodes or edges in dataset. | boolean | no | true |
useSavedContextId | Boolean indicating if a saved context ID should be used. | boolean | no | true |
responseMapping
responseMapping is a single object or an array of objects applied to the raw HTTP response body after a genericService call. Each entry evaluates a JSONata expression against the response and writes the result to a graph node attribute, which is immediately reflected in the table row — no second network call needed.
"promote": {
"type": "genericService",
"label": "Promote",
"settings": {
"relatedConfig": {
"services": ["promoteItemService"],
"responseMapping": { "expression": "results[0].maturityState", "attribute": "state" }
}
}
}
For multiple attributes, pass an array:
"relatedConfig": {
"services": ["promoteItemService"],
"responseMapping": [
{ "expression": "results[0].maturityState", "attribute": "state" },
{ "expression": "results[0].owner", "attribute": "owner" }
]
}
| Field | Description | Type | Required |
|---|---|---|---|
expression | JSONata expression evaluated against the raw HTTP response body. | string | yes |
attribute | Graph node attribute to write the result to. Must match the data field of the target column definition. | string | yes |
When to use responseMapping vs refreshBehavior
| Scenario | Use |
|---|---|
| The service response contains the updated attribute values | responseMapping — instant update, no extra network call |
| The service response does not include the updated data | refreshBehavior: "refreshRowWithColumnService" — re-fetches column services |