Customize the item list in the Agent Inbox panel
Besides chats and calls, agents might work with other records that are specific to how your company works with customers, for example, records of a custom object. You can customize the item list of the Agent Inbox panel to let agents handle records of any object together with chats and calls. For example, show records of a custom object in the In progress list, open the record page when an agent clicks the tile, and highlight records that need attention. To do this, extend the "Agent side bar" (AgentSideBar code) schema of the "Client module" type. The Agent Inbox panel is built on the Omnichannel inbox component and its child components, for example, the Item list component that shows the tiles. Learn more: Omnichannel inbox component.
Add a data source to the item list
The item list shows records of the data sources whose collections are merged into the list attribute. The New items list uses the NewItemsList attribute, and the In progress list uses the InProgressItemsList attribute.
To add a data source to the item list:
-
Open the Contact Center app in the Application Designer.
-
Open the Agent side bar page.
-
Click
→ Source code to open the source code of the Freedom UI page. -
Set up the data source.
-
Go to the
modelConfigDiffschema section. -
Add a data source of the
crt.EntityDataSourcetype.modelConfigDiff schema sectionmodelConfigDiff: /**SCHEMA_MODEL_CONFIG_DIFF*/[...,{"operation": "merge","path": ["dataSources"],"values": {/* Name of the data source. */"UsrCustomObjectDS": {"type": "crt.EntityDataSource","scope": "page","config": {/* Code of the object whose records to show. */"entitySchemaName": "UsrCustomObject","loadParameters": {"options": {"pagingConfig": {/* Number of records to load perpage. */"rowCount": 10,"rowsOffset": -1},/* Order to load the records. */"sortingConfig": {"columns": [{"columnName": "ModifiedOn","direction": "desc"}]}}}}}}}]/**SCHEMA_MODEL_CONFIG_DIFF*/,
-
-
Set up the collection attribute.
-
Go to the
viewModelConfigDiffschema section. -
Add the collection attribute that binds the data source columns to the view model.
-
Add the collection attribute to the
fromproperty of the list attribute. Themergeoperation replaces arrays entirely. When you add a collection to thefromproperty of the list attribute, list the out-of-the-box collections as well. Otherwise, the list does not show chats and calls.viewModelConfigDiff schema sectionviewModelConfigDiff: /**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/[...,{"operation": "merge","path": ["attributes"],"values": {/* Name of the collection attribute. */"UsrCustomObjectItems": {"isCollection": true,"modelConfig": {"path": "UsrCustomObjectDS"},"viewModelConfig": {"attributes": {"Id": {"modelConfig": {"path": "UsrCustomObjectDS.Id"}},/* The "crt.MergeCollectionsConverter" convertersorts the merged items by this attribute. If youdo not specify the attribute, Creatio shows therecords of the object at the end of the "Inprogress" list and at the beginning of the "Newitems" list. Use the same data type as theout-of-the-box collections. Otherwise, the sortorder is unpredictable. */"ModifiedOn": {"modelConfig": {"path": "UsrCustomObjectDS.ModifiedOn"}},/* Attribute for each column that the tileshows. */"Title": {"modelConfig": {"path": "UsrCustomObjectDS.UsrName"}}}}},/* "NewItemsList" for the "New items" list. */"InProgressItemsList": {/* The converter of the "AgentSideBar" schema sorts themerged items by the "ModifiedOn" attribute: indescending order for the "In progress" list and inascending order for the "New items" list. To change thesort order of the merged items, specify the "converter"property, for example,"crt.MergeCollectionsConverter:'ModifiedOn':'asc'." */"from": [/* Out-of-the-box collections. For the "New items"list, "ChatsNewItems." */"ChatsInProgressItems","CallsInProgressItems",/* Collection attribute of the data source. */"UsrCustomObjectItems"]}}}]/**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/,
-
-
Add a tile template.
-
Go to the
viewConfigDiffschema section. -
Add the tile template to the list. Use a layout element, for example, a Flex container layout element, whose child elements show the item data.
viewConfigDiff schema sectionviewConfigDiff: /**SCHEMA_VIEW_CONFIG_DIFF*/[...,{"operation": "insert",/* Name of the data source. */"name": "UsrCustomObjectDS","values": {"type": "crt.FlexContainer","direction": "row","items": [{"type": "crt.Label","name": "UsrCustomObjectTileTitleLabel",/* Bind to the collection attribute, not to thedata source. */"caption": "$UsrCustomObjectItems.Title","labelEllipsis": true},{"type": "crt.Label","name": "UsrCustomObjectTileTimestampLabel","caption": "$UsrCustomObjectItems.ModifiedOn | crt.AdaptiveDateTimeFormat"}]},/* List name. "NewItemsList" for the "New items"list. */"parentName": "InProgressItemsList","propertyName": "items"/* Without the "index" property, Creatio adds the templateafter the out-of-the-box templates. */}]/**SCHEMA_VIEW_CONFIG_DIFF*/,
-
-
Save the changes.
As a result, the In progress list of the Agent Inbox panel shows the records of the object together with chats and calls. Creatio sorts the chats and the records of the object by the modification date: in descending order for the In progress list and in ascending order for the New items list. The collection of calls does not include the modification date, so Creatio shows calls at the end of the In progress list.
Set up the tile of queue items
For Creatio version 10X, the Queued tasks tab shows the queue items of the queues available to the agent, regardless of the assignee. For Creatio version 10.1, the tab shows the unassigned queue items of the queues available to the agent and the queue items assigned to the agent in any queue. In all versions, the tab shows only items that are not in a final status and whose postponement date has passed. Unlike the lists of the Real-time tab, the list of queue items does not use a separate data source for each object. Instead, Creatio reads the columns of each object from the QueueItemsColumns attribute. Out of the box, the tile shows the primary display column of the object as the title. To show other columns, map them to the tile elements. A queue is available to the agent if it is in progress, its object is in the Queue objects lookup and is not marked as a closed queue, and the agent is an active operator of the queue or is assigned to one of its queue items.
To set up the tile of queue items:
-
Add the object to the Queue objects lookup and make sure the object is not marked as a closed queue. Otherwise, Creatio does not show the queue items of this object, except for the items assigned to the agent in version 10.1. Instructions: Manage queue objects (user documentation).
-
Create a queue for the object. Instructions: Create a dynamic queue, Create a static queue (user documentation).
-
Open the Contact Center app in the Application Designer.
-
Open the Agent side bar page.
-
Click
→ Source code to open the source code of the Freedom UI page. -
Add the column mapping of the object.
-
Go to the
handlersschema section. -
Add a custom implementation of the
crt.HandleViewModelInitRequestbase request handler.handlers schema sectionhandlers: /**SCHEMA_HANDLERS*/[...,{request: "crt.HandleViewModelInitRequest",/* The custom implementation of the base request handler. */handler: async (request, next) => {/* Wait for the rest of the initialization handlers tofinish. */await next?.handle(request);const columnsMapping = await request.$context["QueueItemsColumns"];if (columnsMapping) {/* Column mapping of the object. */columnsMapping.push({"entitySchemaName": "UsrCustomObject",/* Each item maps a column of the object to a tileelement. */"columns": [{/* Tile element: "TitleLabel,""DescriptionLabel," "TimeLabel,""ContactName," or "ContactPhoto." */"attributeName": "TitleLabel","name": "UsrName",/* Column path from the queue item to theobject record. */"path": "[UsrCustomObject:Id:EntityRecordId].UsrName"},{"attributeName": "TimeLabel","name": "CreatedOn","path": "[UsrCustomObject:Id:EntityRecordId].CreatedOn"}]});}}}]/**SCHEMA_HANDLERS*/,
-
-
Save the changes.
As a result, the tiles of the queue items on the Queued tasks tab of the Agent Inbox panel show the mapped columns of the object.
Set up the tile click behavior
When an agent clicks a tile on the Real-time tab, Creatio executes the crt.BaseAgentItemClickedRequest request. The out-of-the-box handler of the request opens the chats of the In progress list and does nothing for the chats of the New items list. For calls and other items, it selects the item and, in split mode, hides the item list. Creatio shows a selected call in the item view but does not show other items there. Handle the click on the tiles of your data source in a custom handler. Creatio opens the record page in place of the page that is open in the main area and does not ask the agent to save the changes on that page. Make sure agents save their changes before they click a tile.
To set up the tile click behavior:
-
Add a data source to the item list. Instructions: Add a data source to the item list.
-
Add the dependencies.
-
Add the
@creatio-devkit/commonlibrary as a dependency. -
Add the
sdkargument.Schema dependenciesdefine("AgentSideBar",/**SCHEMA_DEPS*/["@creatio-devkit/common"]/**SCHEMA_DEPS*/,function/**SCHEMA_ARGS*/(sdk)/**SCHEMA_ARGS*/ {})
-
-
Add a request handler.
-
Go to the
handlersschema section. -
Add a custom implementation of the
crt.BaseAgentItemClickedRequestbase request handler.handlers schema sectionhandlers: /**SCHEMA_HANDLERS*/[...,{request: "crt.BaseAgentItemClickedRequest",/* The custom implementation of the base request handler. */handler: async (request, next) => {/* Check the name of the data source of the clicked item. */if (request.collectionName !== "UsrCustomObjectDS") {/* Call the next handler if it exists and return itsresult. This keeps the out-of-the-box behavior of chatsand calls. */return next?.handle(request);}/* Retrieve the instance of the handler chain service from"@creatio-devkit/common." Do not call the next handler foritems of the data source. If the next handler is notcalled, Creatio does not change the selected item and, insplit mode, does not hide the item list. */const handlerChain = sdk.HandlerChainService.instance;/* Send the base request to open the record page. Creatioopens the page in the main area, in place of the page thatis currently open there. Creatio does not check that pagefor unsaved changes. */await handlerChain.process({type: "crt.UpdateRecordRequest",$context: request.$context,entityName: "UsrCustomObject",recordId: request.id});}}]/**SCHEMA_HANDLERS*/,
-
-
Save the changes.
As a result, if an agent clicks a tile of the data source in the Agent Inbox panel, Creatio opens the record page in the main area. Chats and calls open as before.
Filter the items in the list
-
Add a data source to the item list. Instructions: Add a data source to the item list.
-
Add a filter attribute.
-
Go to the
viewModelConfigDiffschema section. -
Add the filter attribute. Set the filter in the
valueproperty using the Creatio filter format.viewModelConfigDiff schema sectionviewModelConfigDiff: /**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/[...,{"operation": "merge","path": ["attributes"],"values": {"UsrCustomObjectItemsFilter": {/* Records whose owner is the current user. */"value": {"isEnabled": true,"trimDateTimeParameterToDate": false,"filterType": 6,"logicalOperation": 0,"items": {"OwnerFilter": {"filterType": 1,"comparisonType": 3,"isEnabled": true,"leftExpression": {"expressionType": 0,/* Column of the object that referencesthe "Contacts" section. */"columnPath": "UsrOwner"},"rightExpression": {"expressionType": 1,"functionType": 1,/* Contact of the current user. Tocompare the column with the currentuser, use "1" and the "SysAdminUnit"reference schema. */"macrosType": 2},"dataValueType": 10,"referenceSchemaName": "Contact"}},"rootSchemaName": "UsrCustomObject"}}}}]/**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/,
-
-
Bind the filter to the collection.
-
Go to the
viewModelConfigDiffschema section. -
Add the filter attribute to the
filterAttributesproperty of the collection attribute.viewModelConfigDiff schema sectionviewModelConfigDiff: /**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/[...,{"operation": "merge","path": ["attributes"],"values": {"UsrCustomObjectItems": {"modelConfig": {"filterAttributes": [{"name": "UsrCustomObjectItemsFilter",/* Reload the collection when the filterchanges. */"loadOnChange": true}]},...}}}]/**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/,
To build the filter dynamically, compute the value of the filter attribute using a custom converter. Use the "usr." prefix in the converter name. Learn more: "converters" schema section.
-
-
Save the changes.
As a result, the item list shows only the records of the object that match the filter.
Show a custom state on the tile
-
Add a data source to the item list. Instructions: Add a data source to the item list.
-
Add the attribute of the state.
-
Go to the
viewModelConfigDiffschema section. -
Add the attribute that binds the column of the state to the
viewModelConfig.attributesproperty of the collection attribute.viewModelConfigDiff schema sectionviewModelConfigDiff: /**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/[...,{"operation": "merge","path": ["attributes"],"values": {"UsrCustomObjectItems": {...,"viewModelConfig": {"attributes": {...,/* Attribute for the "UsrIsUrgent" column of the"Boolean" type. */"UsrIsUrgent": {"modelConfig": {"path": "UsrCustomObjectDS.UsrIsUrgent"}}}}}}}]/**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/,
-
-
Add an element of the state.
-
Add a localizable string that stores the caption of the element. For example, set the code of the string to "UsrCustomObjectTileUrgentLabel_caption." Instructions: Add a localizable string.
-
Go to the
viewConfigDiffschema section. -
Add the element that shows the state, for example, a Label component, to the tile template. Bind the
visibleproperty of the element to the attribute of the state.viewConfigDiff schema sectionviewConfigDiff: /**SCHEMA_VIEW_CONFIG_DIFF*/[...,{"operation": "insert","name": "UsrCustomObjectTileUrgentLabel","values": {"type": "crt.Label","caption": "#ResourceString(UsrCustomObjectTileUrgentLabel_caption)#",/* Bind to the collection attribute, not to the datasource. */"visible": "$UsrCustomObjectItems.UsrIsUrgent | crt.ToBoolean"},/* Name of the tile template. */"parentName": "UsrCustomObjectDS","propertyName": "items"}]/**SCHEMA_VIEW_CONFIG_DIFF*/,
To show time-based states, use the Timer component. Learn more: Set up Timer components (user documentation).
-
-
Save the changes.
As a result, the tile shows the element of the state for the records that match the condition, for example, for urgent records.
See also
Customize the chat view in the Agent Inbox panel
Agent workspace setup (user documentation)
Agent workflows (user documentation)