Customize the Kustomer view
Define how objects are displayed in Kustomer.Articles
Define custom attributes in Kustomer
Klasses determine the data attributes available to standard (Customer, Conversation, Company, Message, and User) objects and your custom objects, or KObjects, in Kustomer. Visit the Data Model Overview to learn more about how standard and custom objects work in Kustomer. You can create, define, and modify Klasses to customize the data attributes for both standard and custom objects to match your business needs. In this article, we'll explore the standard Klasses available in Kustomer and learn how to create custom Klasses to define custom objects, or KObjects. We'll also learn how to add custom data attributes to both standard and custom Klasses.Who can access this feature?User typesAdmins can access the Klass page.In this articleStandard KlassesCreate custom KlassesAdd custom attributes to a KlassMake fields requiredDisplay Klass data in KustomerCreate a form for a custom Klass (Beta access)Create a notification for a Klass (Beta access)View Klass settings and permissionsStandard KlassesStandard Klasses define data attributes for the five standard objects in Kustomer: Customers, Conversations, Companies, Messages, and Users. For example, a standard Customer object refers to an instance of the standard Customer klass, and the Customer klass defines the data attributes available for the Customer object.You can add new attributes to standard Klasses to store custom information for Customer, Company, Conversation, Message, and User objects. When you define new attributes for a standard Klass, the new attributes will be available for any object instance of that Klass in Kustomer.Kustomer provides five standard Klasses: Customer, Conversation, Company, Message, and User.The Customer Klass defines the data attributes available to the standard Customer object and describes Customer attributes.The Conversation Klass defines the data attributes available to the standard Conversation object and is associated with Customers and Messages.The Company Klass defines the data attributes available to the standard Company object and is associated with Customers.The Message Klass defines the attributes available to the standard Message object and is associated with Conversations and Customers.The User Klass defines the data attributes available to the standard User object. It represents all types of Users that can log into Kustomer, and can be used to allow business rules and routing to access custom data. This Klass has no standard attributes defined, but you can add custom attributes to it in the same way as any other standard or custom object.Create custom KlassesYou can use custom Klasses to model individual business objects with multiple relationships or to map to your specialized business process in Kustomer. When you create a custom Klass, you can define the name, icon, and color of the Klass.To create a custom Klass:Go to Settings> Platform > Klasses.Select Add Klass.Enter a name. Optionally, select an icon and the icon's color.Select Create.Add custom attributes to a KlassYou can add attributes to both standard and custom Klasses.To add an attribute:From that object's page, select Create Attribute.Enter a display name for the attribute. Note the following:When you create the new attribute, Kustomer will automatically generate the attribute's name based on the Display Name and data type. For example, an attribute added to a custom Klass for an order with "Assigned User" as the Display Name will have "assignedUserId" as the Name.An attribute's Display Name and Value properties can be changed after creation, but Name and data type cannot.Select a data type from the Type drop-down menu. The following options are available:Data typeDescriptionSingle line textA single line of freeform text. Limited to 1024 characters.ParagraphFreeform text field that can wrap to multiple lines. For example, freeform notes related to a transaction. Limited to 1024 characters.Numbera numeric value. For example, price, quantity, and a numeric tracking number. DateFor example, 01/01/2020. The formatting will match whatever language your app is set to in Personal > Preferences such as English US mm/dd/yyyy or English UK dd/mm/yyyy).Date & Time (Beta access)For example, 01/01/2020, 12:00PM. The formatting will match whatever language your app is set to in Personal > Preferences.URLA freeform field for inputting a URL address. For example, https://www.example.comTrue/FaleA dropdown list where users can select true or false as a response. Multi-level listA list of text values that can include nested sub-categories. For example, Level 1 > Item 1. Limited to 2500 items. If used in a conversational assistant, the list is limited to 32KB, which is around 200-225 items, depending on how long the names of options are.IDAllows you to select any one KObject (custom object) from the timeline and surface it as an attribute. For example, a KObject (from an Order Klass) with order information could be selected and surfaced when viewing a conversation or a customer.User PickerA dropdown list to select an agent or Kustomer admin. Only active users in your organization can be selected.Customer PickerA dropdown list to select a customer name.Select the field value for the attribute type. Available options are:Single Value are fields that accept any value that matches the data type.Option List will only accept pre-defined values.New attributes are turned on by default.Make fields requiredYou can require custom fields to be filled out before marking a conversation as done on the standard Conversation Klass. To do so, select the Required to mark conversation done checkbox when editing the attribute.You can also show agents attributes that are relevant to their current conversation. For more information, see Create conditional attributes in insight cards.Display Klass data in KustomerKlasses describe how individual KObjects will be stored on your Kustomer site. You can adjust the Timeline Layout and Insight Cards to render Klass data for your users. For more information on rendering these views, see Klass Views.Create a form for a custom Klass (Beta access)You can create a form for a custom Klass that appears on the customer timeline and lets agents collect data that can be used for teams to cross-collaborate on that object. For more information, see Tutorial: Create an assignable custom object for a timeline.Create a notification for a Klass (Beta access)If you added a Date field to your Klass, you can alert users of an upcoming due date via email and in-app notifications. For more information, see Create a notification for a custom object.View Klass settings and permissionsYou can customize your Klass by selecting an icon and icon color to represent the object better by going to the Settings & Permissions tab of the Klass you want to customize. You can also view and modify the permissions with access to this Klass directly from this page.Note: This tab is currently in beta access.View and customize object data
You can define how objects like Customers, Conversations, and KObjects (custom objects) are displayed in Kustomer. These views can be rendered in various ways depending on where you want to make the information visible and the object you use.Who can access this feature?User typesAdmins can access the Klasses page to create these views. Agents with access to these views can see them on the customer timeline.In this articleOverviewTypes of viewsInsight PanelInsight DetailsInsight CardTimeline LayoutComponents and stylingOverviewWith the Timeline Layout and Insight Card, you can: Define templates that are associated with a specific type of object.Render the details of an object in various ways.Expose actions that allow users to automate business processes.Types of viewsYour object data can be shown in various areas of the Kustomer platform. Insight PanelWhen working in the timeline, agents can access the Insight Panel on the right side of the window. This collapsible right panel of the Customer Dashboard displays relevant information about the current customer and acts as the home for Insight Details and Insights Card objects. Select the toolbar icon or press the \ key to show or hide the Insight Panel.Insight DetailsInsight Details are displayed in the top section of the Insight Panel sidebar and can be customized to show specific data depending on the object you choose. Remember that there can only be one Insight Details card per object. This card is created by default for both the Conversation and Customer Klass. The following image shows an example Insight Panel for the Customer object.You can customize the attributes displayed by default for both the Conversation and Customer Klass. Learn more in Edit the default Insight Details card.Insight CardInsight Cards are shown in the Insight Panel sidebar, directly below the Insight Details. This card is similar to a widget tied to a specific task. With cards, you can post data to a workflow or make an API call. For example, you can have a card that issues a return or resolves a CSAT rating. Keep in mind that you can have multiple cards per object. The following image shows an example Insight Card with sentiment history.You can customize the default Insight Details view and create up to 100 additional Insight Cards for both standard and custom objects from the Klasses settings page. Learn more in Create a new Insight Card.Timeline LayoutThe Timeline Layout is displayed within a user's expanded timeline and tied to a custom object, such as order. You can display custom order data, such as items and shipping details. This view is only available for custom objects, and you can only have one Timeline Layout per KObject. The following image shows an example of a Timeline Layout for a Shopify order.You can customize the timeline view of a custom object using a visual drag-and-drop editor. Learn more in Customize a Timeline Layout.Components and stylingWhen a new Timeline Layout or Insight Card is created, it is automatically populated with default fields. You can modify the code to remove or add certain fields based on how you would like the Timeline Layout or Insights Card to display your custom data.To view our built-in default components for these views, see our API documentation on Klass Views. You can also use regular HTML elements and are not restricted to these components.If you want to add styling to your components, the style must follow the JSX styling convention. For example, you could create a <div> for one of the fields and add a background color of red like such: <div style={{ background: 'red' }}>.Use Klass relationships to create nested Order objects
If you're integrating an order system in Kustomer, you're likely to come across an example of Kustomer's flexible object model through the use of nested objects. Nested objects (or sub-objects) can be rendered in a Klass View, and might include objects like Shipments, or line items that would belong to an Order.The easiest way to start taking advantage of Order objects would be to browse the Kustomer App Directory and install an ecommerce app integration, which would set these objects up automatically.If you're interested in setting this up manually, this article will walk through multiple methods of setting up klasses with nested objects using the scenario of an orders <-> items being a one-to-many relationship.Who can access this feature?User typesAdmins can access Klass settings.In this articleAutomatic: App integrationsManual Option A: Using the default data field on custom objects (recommended)Manual Option B: Creating and relating multiple klassesFAQAutomatic: App integrationsKustomer offers a variety of app integrations in the Kustomer App Directory. This is the easiest way to get integrated with services like Shopify, BigCommerce, Magento, and more. Learn more about our ecommerce apps in the Kustomer Help Center.Manual Option A: Using the default data field on custom objects (recommended)Note: If you choose to set up orders manually, we highly recommend using Option A because it's simpler and requires less configuration. Option B should only be considered if your use case requires it.1. Go to Settings > Platform > Klasses and create an Order klass in Kustomer, if one doesn't exist already. (These are created automatically if you've installed an ecommerce app integration.) This will expose endpoints like /v1/customers/:id/orders, etc.A POST of an order with many items to /v1/customers/:id/klasses/order would look like the example shown below. Note that we are populating the data field. This field can store the raw JSON data as it is represented in the proprietary system.{ "title": "Order #1", "externalId": "1" "data": { "line_items": [ { "name": "T-Shirt", "price": 20 }, { "name": "Socks", "price": 5 } ] } }Objects implemented with this method would look like this on the customer's timeline in Kustomer:2. In order to create the klass view, go to Settings> Platform > Klasses, then select your Order klass and and press the Edit icon.3. Select the Timeline Layout tab, and then Edit the timeline card.4. Paste in this starter code snippet.<Segment> <Grid> <Column size="ten"> <Grid style={{ padding: '5px 20px', background: '#F7F8F8', border: '1px solid #EAEAEA' }}> <Column> <Grid style={{ fontWeight:'bold', opacity:'.5' }}> <Column size="five" >Item Name</Column> <Column size="five">Price</Column> </Grid> <hr /> {_.map(_.get(kobject, "data.line_items", []), (item) => ( <Grid> <Column size="five">{item.name}</Column> <Column size="five">{item.price}</Column> </Grid>))} </Column> </Grid> </Column> </Grid> </Segment>5. Press Save Changes to finish editing the timeline card.Pros of this method:No need to define klass relationships beforehandNo need for additional API calls to create additional item objects - we can include everything in our POST call to /v1/customers/:id/klasses/ordersDisplay data about an item within an order object instead of making users navigate to a separate objectCleaner customer timeline in KustomerCons of this method:Data in the data object are currently not indexed and therefore cannot be searched or reported on.Manual Option B: Creating and relating multiple klasses1. Create an Order klass in Kustomer. This will expose endpoints like /v1/klasses/orders, /v1/customers/:id/orders, etc.2. Create an item klass in Kustomer. This will expose endpoints like /v1/klasses/items, /v1/customers/:id/items, etc.We now need to define the relationship between the klasses.3. To define the relationships of an Order object having many Items, make the following PUT request to https://api.kustomerapp.com/v1/metadata/kobject.order (the Rel suffix is required here):{ "relationships": { "itemsRel": { "displayName": "Order Items", "target": "kobject.items", "multi": true } } } 4. To define the relationships of an Item object belonging to one Order object, make the following PUT request to https://api.kustomerapp.com/v1/metadata/kobject.items (the Rel suffix is required here):{ "relationships": { "orderRel": { "displayName": "Order", "target": "kobject.order", "multi": false } } } 5. We can now create/update instances of an object that are related to other items:A minimalist POST of an order with many items to /v1/customers/:id/klasses/order would look like this:{ "title": "Order #1", "externalId": "1" "data": {}, "custom": { "itemsRel":["5af9ac1bd672767b2f0a9869","5af9ac21deb0106530702456","5af9ac26deb010553b7024aa"] } }Likewise, an item that belongs to an order would have a POST to /v1/customers/:id/klasses/items and look like this:{ "title": "Item #1", "externalId": "1", "data": {}, "custom": { "orderRel": "5af9ad0cd67276ffe30aa6c0" } }Alternatively, you can also try making a POST to /v1/klasses/orders/:id/itemsRel without the custom object to create the nested object.The ID in orderRel and itemsRel represent the IDs of custom objects that exist in Kustomer. If you do not have the custom objects you want to relate when creating another object (ex: you are creating your order custom object before its respective item objects) yet then you can always make a PUT request to /v1/klasses/:klassName/:id to add the related objects later.Please note that setting an array of multiple objects (like itemsRel) will overwrite the existing itemsRel array on that object instead of appending to it.Objects would look like this on the customer's timeline:Pros of this method:Splitting objects out into multiple Klasses means Kustomer admins can build Saved Search queries on the custom fields in the object. This is currently not supported by nested Obj custom fields described below.In the above example, the Order Items get to be their own entity with their own set of Klass endpoints. Ex: if you wanted to just find an Order Item object by its external ID, then you could make a request to /v1/klasses/items/externalId={externalId}No nesting limitations like the Obj custom fieldCons of this method:Requires defining the relationships beforehandYou have to manage creating/updating each object with its relationships, which ultimately means more API calls as opposed to a create/update for a single Order object that has an Obj custom field for items.More objects on the timeline can potentially add a lot of clutter for agents viewing the timeline.FAQQ: What is the purpose of the data field?The data field can be any JSON object with any amount of nesting. We do not index on the items in this field so it will not be searchable. However, this data object will be available for rendering in a Klass View.Customize a Timeline Layout
Klasses define the data attributes associated with each object type in your platform. You can create attributes that are added to your standard Klasses or create custom Klasses that define your business's unique custom objects. Who can access this feature?User typesAdmins can access the Klasses page.You can display custom Klass objects, such as order, in Kustomer using a Timeline Layout available within a customer's expanded timeline. With the Timeline Layout, you can display the custom order attributes that are most relevant to your agents, such as order items and shipping details. Notes:This view is only available for custom objects.You can only have one Timeline Layout per Klass object.Existing Klasses with a Timeline Layout will only be editable in the Code Editor.In this articleEdit the Timeline LayoutUse the Timeline Layout visual editorUnderstand blocksChange the style of a blockEdit the Timeline LayoutOnce you create a new Klass, a Timeline Layout is automatically created with the visual editor, where you can customize the timeline view of a custom object. In this example, we will customize a timeline layout for a Shipping klass showing relevant attributes, such as shipping date and tracking number.To access the Timeline Layout visual editor:Go to Settings> Platform > Klasses. Select the custom Klass and go to the Timeline Layout tab.Select Edit Card to open the Timeline Layout visual editorOptionally, if you want to use this object as a custom task, you can allow users to leave comments on the Timeline Layout view by turning on the toggle.Note: The ability to create custom tasks is currently in beta access.Use the Timeline Layout visual editorThe left pane on the Timeline Layout shows all of your active standard and custom attributes, as well as components that can be added to the layout. The center space in the editor is where you will build and customize the Timeline Layout to best suit your needs. Here, you can add all of the necessary attributes and components your agents will see to get the information they need at a glance. The Settings pane on the right will show all of the available settings for each block in your layout and is where you can visually customize them further. See Change the style of a block for more details.Understand blocksA block is a row in your layout containing attributes or other component information, such as an image. You can add attributes and components to a block by dragging and dropping it from the left pane.You can also select Add Attribute or + to open a menu listing all available attributes and components for you to use.Note: Attributes can only be used once. Attributes already used will appear in a gray box and visually indicate that they are no longer available.Blocks can have up to 3 columns. To designate how many columns will be in a block, you can drag and drop the components from the left pane, or select Add Block and select an option from the drop-down menu. Here, we will select 2 Columns Block.Drag the desired attribute or component to each space once you designate the number of columns in a block. You can also select Add Attribute and pick the desired column or attribute from the open window.Tips for working with blocks:A block can't have more than 3 columns at a time.You can add multiple fields within each column.Change the style of a blockYou can change the visual style of each block in your Timeline Layout by selecting it to view the individual options for it in the Settings panel on the right. For example, here, you can either delete the block from the layout or customize the style of it.Note: The fields in the Settings panel will change depending on the component type currently selected.The available style options are:Border Style is the type of border that will surround the block. You can select from Dotted, Dashed, Solid, or None.Border Width is the width of the border that will surround the block.Border Color is the color of the border that will surround the block. You can select a color from the palette or enter specific Hex, RGB, or HSL codes.Once you make your changes, the editor automatically applies the visual settings. You can also see the styling by selecting Preview. Select Exit Preview to return to the editor.Once you are done creating the Timeline Layout, it will be visible in the customer's timeline.Customize Insight Cards
Klasses define the data attributes that are associated with each object type in your platform. You can create attributes that are added to your standard Klasses, or create custom Klasses that define your businesses unique custom objects. You can display data for both standard and custom Klass objects in Kustomer using Insight Panel and Insight Details Cards that are available in the Insights Panel. With these cards, you can display attributes that are most relevant to your agents, such as additional customer details or their individual CSAT score.Who can access this feature?User typesAdmins can access Klass settings.In this articleUse the visual editorEdit the default Insight Details cardCreate a new Insight CardUnderstand blocksCustomize component blocksUse the visual editorYou can use the visual editor to create or edit Insight Details or Insight cards. With the editor, you can use drag-and-drop to add or remove attributes shown on the card, change the order in which they are displayed, or add additional components, such as a paragraph or button. Note: Existing cards can only be edited in the Code Editor.The left pane of the editor shows all of your active standard and custom attributes, as well as components that can be added to the card. The center space in the editor is where you will build and customize the card to best suit your needs. Here, you can add all of the necessary attributes and components your agents will see to get the information they need at a glance. The Settings pane on the right will show all of the available settings for each block in your layout and is where you can visually customize them further. See Understand blocks and Customize component blocks for more details.Edit the default Insight Details cardThe Insight Details card comes installed by default in every Kustomer organization for the Conversation, Company, and Customer Klass. This card lets you quickly see both standard and custom attributes for the customer or conversation you're viewing such as name, conversation status, or email address. The example below shows the default Insight Details card for a conversation.You can customize the attributes displayed in this card by going to Edit Klass Settingsin the upper-right corner of the card, next to the Edit icon, and making your desired changes in the editor.Create a new Insight CardYou can create up to 100 cards for both standard and custom klasses. In this example, we will create a card for a custom Shipping klass. The card will include specific customer details, such as name and email address, so that an agent can quickly see the customer related to shipping information.To create an Insight Card:Go to Settings> Platform > Klasses. Select the Klass you want to create a card for and then go to the Insight Cards tab.Select Create Insight Card.Enter a name for the card and select Create.Understand blocksA block is essentially a row in your card that contains attributes or other component information, such as a button. You can add attributes and components to a block by dragging and dropping to from the left pane.You can also select Add Attribute or + to open a menu that lists all of available attributes and components for you to use.Note: Attributes can only be used once. Attributes that have already been used visually indicate that they are no longer available.Customize component blocksYou can customize some component blocks by selecting it to view the individual options for it in the Settings panel on the right. For example, here, you can either delete the block from the card view, or customize the text and URL used in a link.Note: The fields in the Settings panel will change depending on what type of component is currently selected.Once you make your changes, the visual settings are automatically applied in the editor. You can also see the styling by selecting Preview. Select Exit Preview to return to the editor.Once you are done creating a new Insight Card, it will be visible in the Insight Panel for the selected klass. Since we added this card to the Shipping custom klass customer's timeline, you can view it once you select it in the customer's timeline.Code Editor for Insight Card or Timeline Layout
You can modify an Insight Card, Insight Details Card, or Timeline Layout through code to remove or add certain fields based on how you would like them to display your custom data. To see the code, select the View Code tab that is located at the bottom of the visual editor.If you want to make changes, select Convert to Code. If you are sure you want to switch to the code view, enter CONVERT in the box and select the option confirming you want to make this change.Note: Once you convert the visual editor to code, you cannot undo this change.You can learn more about the components available for these views in the Kustomer JSX Components page. You can also use regular HTML elements and are not restricted to these components.If you would like to add stying to your components, the style must follow the JSX styling convention here. For example, you could create a <div> for one of the fields and add a background color of red like such: <div style={{ background: 'red' }}>.Timeline Layout and Insight Card Versioning
There are times where you will need to update your existing timeline layouts or insight cards to add or remove information. Versioning makes it simple to track all of your view changes and switch between different versions, as needed.Who can access this feature?User typesAdmins can access the Klasses page.To access versioning:Go to Settingsand select Klasses followed by the klass.Select the Timeline Layout or Insight Cards tab and select the view you want to edit. Versioning is available in the Settings pane of the selected view.Creating a new versionTo create a new version of your timeline layout or insight card, simply edit either view and save your changes. A new version will be created every time you select Save Changes. You can have up to 30 versions of a view available. Once you reach this maximum, the oldest version will be rewritten.Note: Switching to the code editor is a permanent action. If you select an earlier version that was created in the code editor, your view will change to code and can’t be switched back to the visual editor.Accessing a different versionTo change the version of your timeline layout, insight details, or insight card, select an option from the Version drop-down menu. You can instantly compare versions to see what changed between them, or edit a previous version. Note: You can restore the Insight Details card to its original view by selecting Restore to default.Select Save Changes to restore the version that you select.App installed viewsIf you install an app that also installs default insight cards or timeline layouts, such as the Shopify app, the default view will be considered the default version. When the app is updated, the default version will be replaced with the latest app installed view. Older versions of the view will be saved and you can revert back to them at any time.Create conditional attributes in insight cards
Conditional attributes allow you to simplify screen views for agents by only showing attributes that are relevant to their current conversation. This works by requiring an attribute selection to be made for the next attribute to appear. If no attribute is selected or an attribute is selected that doesn't require further information, then those fields will remain hidden. For example, if an organization has a Contact Reason card with a multi-level list that your agents use to add details about the conversation could result in a long list for agents to scroll through to fill out. Instead, using conditional attributes you can reveal further attribute options based on if the previous attribute was filled out as the agent works through the card. Who can access this feature?User typesAdmins can create conditional attributes. Users with access to the specific attribute via a permission set can see the field.In this articleCreate conditional attributesSet a conditionally required attributeCreate conditional attributesYou can make attributes in an Insights Panel Details or Insights Card a conditional attribute that displays based on if another attribute in this view is set. You can create conditional attributes in cards that are built using the visual builder, or in the code editor under the Conditions tab. Learn more about setting up conditions in the code editor in Kustomer Developer Portal: JSX in Kustomer.In this example, we are going use the visual builder to add 3 custom attributes to a card for Country, Region, and City and set the following conditions:Only show the Region attribute if the Country attribute is set to USA.Only show the City attribute if the previous attribute Region is filled out.To create conditional attributes in the visual builder:Go to Settings > Platform > Klasses.Select the Klass you want to create conditional attributes in. For this example, we will use Conversation.Select the Insight Cards tab and then either select an existing visual builder card or create a new one. For this example, we are going to click Editon an existing Insights Panel Details card.Drag attributes from the Attributes panel on the left that you want to use to the center space in the editor. Here, we will use Country, Region, and City.Select Region and then select the Set conditions for attribute check box in the Attributes panel on the right.Note: The Set conditions for attribute check box will only appear for custom attributes and select attributes that allow for conditional conditions to be set.To create the condition that needs to be met for the Region attribute to display, select your choices from the drop-down menu. In this example, we only want to show this attribute if an agent enters USA in the Country attribute. Using the drop-down menus and text box, enter Country Equals USA.Next, select the City attribute and select the Set conditions for attribute check box.Since we want this attribute to show when a value is entered in Region, select Region and Has Any Value from the drop-down menus.Select Save Changes > Save to confirm the action.When you view your Insights Panel Details card, you'll notice that the Country attribute is the only one visible by default. Once you fill it out with the value we specified, USA, the Region attribute appears and so on.Note: If an agent doesn’t have access to view a specific attribute through field level permissions, they aren't able to see the attributes in the card.Set a conditionally required attributeIf you want to make sure agents always enter specific information, you can set a conditional attribute to be required before marking a conversation as done. Notes:Conditionally required attributes are only available for an Insights Panel Details card in the Conversation klass.Only custom attributes can be set as a conditionally required attribute.Let's build on our previous example that displays the Region and City attributes only if the previous attribute is set. Here, we want to make sure that agents are filling out all of these attributes for customers in the USA. To do so, we can set these conditional attributes to be required before a conversation can be marked done.Go to the Insights Panel Details card in your Conversation klass.Select the Region attribute and then select the Require this attribute to mark conversation done check box.Repeat this step for the City attribute.Tip: You can hover over theicon to view the conditions for an attribute.Select Save Changes > Save to confirm this action.When viewing the card, you'll notice that conditional attributes that are required to be marked done are marked in red to indicate that they must be filled out.Notes:Conditionally required attributes are only required to mark a conversation as done if the attribute it depends on is filled out. For example, if the Country attribute is left blank, you can close the conversation without having to enter data in the Region and City attributes. All conditionally required attributes are validated in the Insight Panels Details card and the Required Attributes for Completion window (front end) and not through the API (back end), which means that conditionally required attributes aren't validated in workflows or business rules that mark conversations done. Let's say you have a business rule that marks a conversation done if Country is set to USA. The business rule will close this conversation regardless of whether Region and City are filled out since these attributes are only conditionally required on the front end.If you attempt to mark a conversation done without entering data into a visibly required attribute, a window opens alerting you to the fact that there are incomplete required attributes. You can enter data for them directly from this view. If you have multiple conditional attributes set as required, they will appear in this window as you enter data for the attribute it's dependent on.Trigger a workflow from an Insight Card
There may be times when you want to trigger a workflow to run an automation manually, instead of waiting for an update within Kustomer to trigger the workflow. Currently, a Kustomer workflow can be triggered to run by a number of different reasons, including actions such as, conversation update, customer create, and note create. Users and organizations will oftentimes make manual changes to a Klass by adding a tag or changing the value of an attribute to trigger a workflow. However, there are also alternative options, such as creating an insight card with buttons that send data and trigger workflows to make updates. In this article, we will go through how to set up a simple insight card that has buttons to manually change a custom attribute on the conversation Klass.Who can access this feature?User typesUsers with permission set access to the Klass Management, Webhooks, and Workflows settings pages.In this articleCreate a Form webhookCreate a workflowCreate an Insight CardCreate a Form webhookGo to Settingsand select Platform > Inbound Webhooks.Select Add Inbound WebhookEnter a Name and Description for the webhook.Then, select Form as the webhook type.Select CreateOn the Inbound Webhooks page, go to the Form Hooks tab, find your newly created webhook , select the menu icon , and the select Copy Hook Address. Store the hook in a secure location as you will need it for future steps.Note: We recommend turning on the debug logs for the webhook to make troubleshooting any errors much simpler and also give you additional insights into the data. You can do so by selecting the edit icon to edit the webhook and turning on the Debug option.Create a workflowGo to Settingsand select Platform > WorkflowsSelect Add Workflow.Select Custom Workflow to create a new workflow from a blank state.Enter a Title and Description for the workflow.Select the first trigger event and then change the Trigger App to Hooks and the Trigger Event to your newly created webhook.From here you can cater the workflow to run for whatever action you’d like. You can learn more about workflows here. In this example, the workflow changes a custom conversation attribute to “true” and adds a tag to the conversation. Here is a brief overview of the workflow. Step 2 shows how to target the Conversation ID that will be coming over from a button click in our insight card in the following steps. Create an Insight CardGo to Settingsand select Platform > Klasses.Select Create Insight Card.Enter a Name and option Icon for the Insight Card.Select View Code in the bottom left, then Convert to Code. Fill out the form with the word CONVERT.Note: This is a permanent action, and you will not be able to then convert this Insight Card back to a visual card.Select Convert to Code.Copy and paste code snippet below into the Code tab// const convoPut = "FORM HOOK GOES HERE" // Example with form hook -> const convoPut = "https://api.kustomerapp.com/v1/hooks/form/60b906379e2843533971e874/2fd70fbcf4c9e2892c7c52dfced79445bf4d288279548c400ba78013594fa57f" const data = this; const labelStyle = { "margin-left": "5px" }; const inputStyle = { width: "95%", display: "block", "margin-left": "5px", "margin-bottom": "5px", "margin-top": "2px", height: "25px", "font-weight": "600", "border-radius": "5px" }; const textareaStyle = { width: "95%", display: "block", "margin-left": "5px", "margin-bottom": "5px", "margin-top": "2px", height: "100px", "font-weight": "600", "border-radius": "5px" }; const buttonStyle = { width: "95%", background: "#52AAFF", padding: "5px", border: "none", margin: "5px", color: "white", fontSize: "1.1rem", fontWeight: "500", fontFamily: '"Neutral Std", "Helvetica Neue", Arial, Helvetica, sans-serif', borderRadius: "5px", height: "2.2em", cursor: "pointer", marginBottom: "10px" }; const centerAlign = { textAlign: "center", marginTop: "10px" }; const state = { payload: {}, kobjects: [], }; function omitter(e) { e.preventDefault(); const conversationId = document.getElementById("conversationId").value; fetch(convoPut, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ conversationId: conversationId, }) }) } <form id="omit"> <input type="hidden" id="conversationId" name="conversationId" value="{`${_.get(conversation,"> <input type="button" value="Omit Convo"> omitter(e)}/></form>Select Save Changes.You should see an insight card with a single button when viewing a conversation. The final step is to add the URL of the form webhook to the first line of the CSAT Omit insight card. This URL is what we saved earlier in step six of the Create a Form webhook procedure above. Adding the URL here is the connection between the button on the conversation timeline that sends the data to the workflow we built. Clicking the button in the insight card will capture the conversation ID and then send the ID to the workflow.This setup builds upon Kustomer’s existing capabilities and can be quite valuable to understand how the connection works to build even more complex Insight Cards.Deep link to external pages in an Insight Card
You can reference dynamic content in an Insight Card to create deep links to external sites, allowing agents to jump directly to a relevant page like a customer's profile on social media or other systems. Deep links can be created on the Customer, Conversation, Company, and KObject klasses.Who can access this feature?User typesAdmins can access the Klasses page. Users with Timeline access can use deep links in Insight Cards.In this articleWhat are deep links?Add an attribute for the deep linkCreate a deep link in the visual editorSetting a fallback linkResultsWhat are deep links?A deep link is a URL that takes you directly to a relevant page within an external site, rather than the homepage. The impact of this is that agents can skip having to search on the external site manually, and will be able to click a link directly to the results of a search. Eliminating repetitive tasks can improve your agents' productivity and turnaround time.For example, if you have a search system with a url of https://myhomegrown.system.com/customers?email=customer+email@example.com, an agent might usually be required to start a the search homepage and enter the customer email address manually. By using a deep link on a URL with predictable formatting, you can create links in Kustomer that use dynamic text to insert the customer email address into the target URL, allowing an agent to bypass manual search. Learn more about deep linksIn an Insight Card, you can reference a deep link through the Button or URL components. These are styled differently but function identically, so you can pick whichever method you prefer. Add an attribute for the deep linkFirst, an attribute will need to be created that matches the URL format in your target external system, if it doesn't already exist in your Kustomer organization. Depending on the page you're linking to, this could be an email address, a unique identifier, or some other predictable string. Your attribute can be set on the Customer, Conversation, Company, or KObject klass.As an example, we'll walk through a tutorial setting up a deep link on the Customer klass that allows an agent to open an Airbnb listing from an Insight Card. This card uses dynamic text to reference an Airbnb Listing ID to match the URL format of https://www.airbnb.com/rooms/12345678, where the numeric string at the end is the Listing ID.In the Klasses settings, on the Customer klass, create an attribute to reference in the deep link. In our Airbnb example, the Listing ID is a single line text string.Create a deep link in the visual editorUse the visual builder to customize Insight Cards with deep links. Deep links can be added to Insight Cards on the Customer, Conversation, Company, and KObject klasses. To continue this Airbnb tutorial, we'll add an Insight Card to the Customer klass that includes the Airbnb Listing ID and displays a link to view the listing on the external Airbnb site.To add a deep link in an Insight Card:In Settings go to Platform > Klasses.Edit the klass. Following this Airbnb tutorial, you would edit the Customer klass.Open the Insight Cards tab and select Create Insight Card.Fill in a Name and Icon to begin customizing the card in the visual builder.Use the Components list in the sidebar or select Add Attribute to add a Button or URL component.Fill in the Button Text as preferred to set a display name for your link.In the Button Link field, add the static part of your URL. In our Airbnb example, we'd add everything up to the Listing ID: https://www.airbnb.com/rooms/.Finish setting the link by selecting the Dynamic Text button in the Button Link field, and select the desired attribute.Add a fallback link, if desired.When finished, Save the Insight Card.Setting a fallback linkA fallback link is used provide an alternate next-best destination address for the dynamic link in cases where the specified attribute does not exist. This would be a useful way to give agents who click this link a secondary suitable landing page, instead of directing them to a nonexistent page that would result in a 404 error.To set a fallback link, check the Add Button Link fallback box while editing the attribute in the Insight Card. Then, use the field provided to specify the alternate URL to use in cases where the attribute is blank. This may be a homepage, search index page, or whatever fits your team's workflow best.For our Airbnb tutorial, we'll set the fallback link to the external homepage.ResultsAgent users will now be able to access the deep link button/URL in the Insight Card.In cases where the attribute is set, the button/URL in the Insight Card will take you directly to the deep-linked page.When the attribute is blank, the fallback URL will be used and the button will take agents to the fallback homepage.Without setting a fallback, the destination of the button will be whatever the target site uses as their own fallback in the event of a malformed URL. This could be the homepage, but it could also be a 404 error or some other unintuitive result. By providing your own fallback URL, you can work around limitations in the external system to provide the next-best result for your agents.Creating team-based Insight Cards
Custom Insight Cards provide some of the most versatile functionality possible within the Kustomer platform. You can use these cards to provide information to users, create processes, or provide anything an agent may otherwise need within arm's reach. Sometimes, you may want an insight card to display only for a particular team in your platform. For instance, you may have an escalation process that runs through an insight card that is necessary for your agents but not your managers. The instructions below will help you implement an insight card that can only be seen by users on a particular team you designate.Who can access this feature?User typesAdmins can access the Klasses page.In this articleCreate a team-based Insight CardHow this worksCreate a team-based Insight CardFind the ID of a team for which you wish to access a specific insight card. This ID can be found at the end of the web URL in your browser when editing a team's details in the Kustomer app.To create an Insight Card, go to Settingsand select Platform > Klasses.Add a new Klass, or select the one you want to create an Insight Card for.Select the Insight Card tab and then select Create Insight Card. For more information, see Customize Insight Cards.Select View Code at the bottom of the editor and then Convert to Code.Paste the following code in the editor:{_.get(currentUser, 'teams', []).map(team => team.id).find(teamId => ["TEAM_ID_GOES_HERE"].includes(teamId)) && <div> { /* START OF INSIGHT CARD CONTENTS */ } THIS IS WHERE YOUR INSIGHT CARD CONTENTS GOES { /* END OF INSIGHT CARD CONTENTS */ } </div>} Replace TEAM_ID_GOES_HERE in the first line with the ID you obtained in step 1. Do not remove the double quotations. Insert the code of the insight card you wish to have run or display for people assigned to this team by replacing the THIS IS WHERE YOUR INSIGHT CARD CONTENTS GOES text on the code sample above. When finished, Save your changes.How this worksAt this point, you have an insight card with contents that will only be displayed for users who are on a particular team within your platform. These users do not need to log in as that team; only assigned to the team. If a user is not on the team this insight card was created for, they will still see the title of the insight card when viewing the card's context, but they will not be able to see its contents.You can leverage the code below to display additional code based on several teams. If someone is on the first and second team designated below, they will see their insight card as if the code designated within the first and second team is running, but the code for the third team will be omitted.return( <> {_.get(currentUser, 'teams', []).map(team => team.id).find(teamId => ["FIRST_TEAM_ID_GOES_HERE"].includes(teamId)) && <div> { /* START OF INSIGHT CARD CONTENTS */ } THIS IS THE TEXT AND CONTENT SEEN BY THE FIRST TEAM { /* END OF INSIGHT CARD CONTENTS */ } </div>} {_.get(currentUser, 'teams', []).map(team => team.id).find(teamId => ["SECOND_TEAM_ID_GOES_HERE"].includes(teamId)) && <div> { /* START OF INSIGHT CARD CONTENTS */ } THIS IS THE TEXT AND CONTENT SEEN BY THE SECOND TEAM { /* END OF INSIGHT CARD CONTENTS */ } </div>} {_.get(currentUser, 'teams', []).map(team => team.id).find(teamId => ["THIRD_TEAM_ID_GOES_HERE"].includes(teamId)) && <div> { /* START OF INSIGHT CARD CONTENTS */ } THIS IS THE TEXT AND CONTENT SEEN BY THE THIRD TEAM { /* END OF INSIGHT CARD CONTENTS */ } </div>} </>);Add the KustomerRequest method to an Insight Card
Insight Cards allow you to display attributes that are most relevant to your agents, such as additional customer details or their individual CSAT score. Insight Cards can also be used to support complex integrations and access data from across the platform, and even pull data from 3rd party APIs and resources.This article will walk through an example of using the KustomerRequest method to make an API call from an Insight Card and display some data from that response in the card. This will be a very basic example of how this method can be used, but you can extend these concepts to create even more powerful integrations.Who can access this feature?User typesAll users with permissions to access Insight Cards.In this articlePrerequisitesCreate the Button and contentAreaAdd the KustomerRequest methodAdditional practicePrerequisitesBefore beginning this tutorial, you should have a general understanding of the Kustomer cards SDK and how it works. You will also benefit from having some general familiarity with the Kustomer Cards Methods and what they are used for.Lastly, you should be comfortable working inside the Insight Card code editor. While it's possible to build Insight Cards entirely with the visual editor, you will need to know how to use the code editor and understand basic JavaScript to add these methods to your card.Create the Button and contentAreaThe first step is to add the Button attribute and contentArea to the Insight Card. The button will be used to submit the API request, and the contentArea will be where the data returned from that request is shown. The simplest approach will be to use the Button component from the Kustomer component library. This will pass the default styling to the button and allow you to easily add an onClick handler.First, you will need to add an opening and closing button tag. Make sure the B is capitalized so that you are using the Kustomer Button component and not the standard button HTML element.Then, give the button some text to describe what it does. This text will be added between the two tags. In this example, we are going to be getting the customer's email address, so the button can say Get Email.Add an opening and closing <div> tag that will wrap the entire block of code, which will allow the addition of multiple components.Next, create another div under the button component. Give this div an ID of contentArea. This ID will be used later to target that div and insert a customer email address. Then, set up the onClick handler. This will trigger an action when the button is clicked. Add onClick={() => {}} inside the opening <Button> tag. You will add the action to perform inside the second set of curly brackets.Last, we'll run a test using the console to ensure the onClick handler is set up correctly. To test this, add console.log("clicked") inside the curly brackets. Now when you select the button with the console open, you will see "clicked" each time you press the button.If the test was successful, you're ready to add the request method.Add the KustomerRequest methodTo utilize the Kustomer API in your card, you will need to call the KustomerRequest method from inside the onClick handler. Use async/await to do this asynchronously. Start by adding async () => {await KustomerRequest({}) inside your onClick handler.Once the request method has been added you can begin constructing your requests. For this example we are going to do a GET request to the customers endpoint to get the current customer's email address.For the URL, add the path /v1/customers/:customerId. Get the ID from the context that is readily available within the card by using customer.id.For the method, use GET.It won't be required to add a request body or header for this example, because the request method automatically generates a token to authenticate the request. However, if you were doing a POST or PUT request you would construct your body in the same way.Because this is a GETrequest, you will want to see some data. To do this, you'll need to access the response from the request.After the closing parenthesis from KustomerRequest, add .then((response) => {}).The response for the original API Request will be available by targeting the response attribute. You can then manipulate and use that data.Pull the customer's email address by targeting response.data.attributes.emails[0].email.This value will be in JSON format, so we need to use JSON.stringify() to convert it into a string in order to display the value in the card.Now that you have the stringified version of the customer's email address, use getElementById to target the content area that was created earlier and add a paragraph element inside the original div to show the customer's email address. Additional practiceAfter you're comfortable with the basics of using the KustomerRequest method, here are some other things you can try.Try making a POST or a PUTrequest to one of the Kustomer API endpoints to create or update the Customer, Conversation, or another Klass.To do this you will need to change the method to PUT or POST as well as add a request body.This is an example of a PUT request to change a customer's name.Try making a GETrequest to an external API.This may require you to add a form of authentication in the request as a header to authorize the request.The types of headers will differ for each API.Display KObjects on an Insight Card
Kustomer's timeline layout gives you full customer context by showing conversations, orders, and other custom data in one place. Another key feature of Kustomer is the ability to take key information for a customer or conversation and highlight it in an Insight Card for easy access.In this tutorial, you'll learn how to view KObject data from a custom Klass within an Insight Card. This Insight Card is designed to be used with customer timelines that have up to 100 KObjects on them. For the purposes of this article, we'll use a custom Orders Klass to show on the customer timeline, but you can apply these skills to fetch any custom KObject data and place it on any Klass. Who can access this feature?User typesUsers with permissions to access Klasses.In this articlePrerequisitesCreate Insight Card and convert it to codeAdd code to Insight CardCustomize the code with your KlassShow a different attribute in the Insight CardCustomer Order Objects code samplePrerequisitesBefore following this guide, we recommend being familiar enough with the React JavaScript library to make customizations in code. If you're new to React, learn more from the React documentation in Intro to React.Create Insight Card and convert it to codeNew Insight Cards use the visual builder by default, but for this tutorial, you'll switch to the code editor to insert the provided code sample that sets up the rest of the card.To set up the Insight Card:Go to Settings> Platform > KlassesSelect the Customer Klass.Switch to the Insight Cards tab.Select Create Insight Card.Fill out the Name and Icon as desired. If you're following the example, name the Insight Card Order.The visual builder will appear. Select View Code from the bottom of the screen.Select Convert to Code.Type CONVERT in the field to confirm the conversion.Add code to Insight CardYou'll now have a blank Insight Card within the Customer Klass. Next, you'll add the code sample into the Code tab of the Insight Card.To add the code sample:In another browser tab, scroll down to the Customer Order Objects code sample in this article. Select the whole code block and Copy it to your clipboard.Back on the Edit Insights Card screen, click into the Code field. The text insertion cursor should be blinking.Paste the code sample into the code field.At the bottom of the screen, select Save Changes.After saving these changes, an Insight Card will be created that pulls in all Orders objects on a customer's timeline.Customize the code with your KlassNext, you can modify the code sample to add your own Klass to the Insight Card.To update the code with your custom Klass:Go to Settings> Platform > Klasses.Copy the name of the desired Klass exactly as it appears on the Klass Management page. In the example shown below, you would use the name damage_claim, rather than Damage Claim.Go back to the code editor on your new Insight Card.On line 10, replace order with the name of your Klass.On line 48, replace order with the name of your Klass.At the bottom of the screen, select Save Changes.Once the Insight Card has been saved, it will start showing data from the added Klass.Show a different attribute in the Insight CardThis Insight Card will show a list of the KObjects on a customer's timeline along with their createdAt dates. As before, you can customize the code to replace the createdAt column with a different attribute.To show a different attribute in the Insight Card:Go to Settings> Platform > Klasses.Select the Klass you added to the Insight Card earlier in this article.Copy the camelCased name of the attribute you'd like to add to the Insight Card. For example, to add the Claim Status custom attribute from the list below, copy claimStatusStr.Go back to the code editor on your new Insight Card.On line 50, replace the createdAt text with your attribute. If you are using a custom attribute, you'll want to add custom. in front of your attribute name.On line 57, replace the Created At text with a title that describes the attribute you just added to line 50.At the bottom of the screen, select Save Changes.Your Insight Card will now display the newly-added attribute instead of the createdAt attribute.Customer Order Objects code sample//Retrieves the customer ID const customerId = _.get(this.context.customer, "id"); //Creates table variable const Table = 'table'; //Gets all objects on the customer timeline const fetchObjects = () => new Promise((resolve, reject) => { this.KustomerRequest({ url: `/v1/customers/${customerId}/klasses/order`, method: 'GET' }).then((kobjects) => { resolve(kobjects) }).catch((e) => { throw e }); }); //Initialization <React.Fragment> {(() => { class Test extends React.PureComponent { constructor(props) { super(props); this.state = { objects: [], }; } async componentDidMount() { try { const objects = await fetchObjects(); this.setState({ objects: objects.data }); } catch (e) { console.log( "%c Past Objects", "color:red;font-family:system-ui;font-size:4rem;-webkit-text-stroke: 1px black;font-weight:bold" ); console.log(e); } } generateTable(objects) { let correctOrder = objects.reverse(); const tableCells = correctOrder.map((object) => <tr> <td> <Kobject id = {object.id} type = "order" /> </td> <td>{object.attributes.createdAt}</td> </tr> ); return( <Table style={{width: "100%",border: "1px solid #dddddd"}}> <tr> <th>Order Title</th> <th>Created At</th> </tr> {tableCells} </Table> ) } render() { return ( <div> {this.generateTable(this.state.objects)} </div> ); } } return React.createElement(Test); })()} </React.Fragment>;Link a custom object to a conversation
Within the Kustomer platform, it is common for organizations to have custom objects (KObjects), with one of the most common being an order. When a customer writes in about an order, the agent may want to link the specific order to a conversation. This article will walk you through the steps to link a KObject to a conversation.Who can access this feature?User typesAdmins can access the Klasses page.In this articlePrerequisitesGetting startedLink a KObject to a conversationPrerequisitesUnderstanding of standard and custom objectsUnderstanding of Klass viewsGetting startedAn essential part of this process is that your organization has created a custom Klass with a defined set of attributes. For this example, we will be referencing a custom Order Klass.Link a KObject to a conversationFirst, navigate to Settings > Platform > Klasses and seelct Conversation. Next, add the new field to link the custom object. Set a Display Name, select Id as the Type, and set the Target to the specific KObject you would like to link.If you do not have a custom Klass View for the Conversation Insights Panel Details (the top right section when viewing a conversation), you must continue to Step 4. If you have the standard Insights Panel Details, navigate back to a conversation and hard refresh. You will then see the new custom attribute with a drop down to select the particular order tied to a customer.If you have a custom Klass View for the Conversation Insights Panel Details, you must edit the code to see the Order object in the dropdown. Once you are in the Edit Klass View page, add a new Row and reference the custom attribute. For the Order attribute we created earlier, use the following code as an example:<Row field={'orderId'} label="Order" value={object.custom.orderId} object={'conversation'} /> It is helpful to note that you can also see a Preview of the Insights Panel Detail further down on the Edit page.Once the KView is updated, navigate back to a conversation and hard refresh. You will then see the new custom attribute with a drop-down menu to select the particular order tied to a customer.While we used a custom Order in this example, it is important to note that you can link any type of custom object to a conversation! Change the Target when creating a new custom attribute and adjust the KView if needed.
Still need help? Contact Us