---
sourceDocument: Brazil Build or modify applications
sourceDocumentLink: https://www.servicenow.com/docs/r/application-development

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Build or modify applications

ft:clusterId :

    - cadev

bundleId :

    - cadev

workflow :

    - Development, Data, and Analytics


---

# Analytics Q\&A component setup

# Analytics Q\&A component setup {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 9 minutes to read  
Through Natural Language Query, the Analytics Q\&A component enables any user, regardless of technical background, to discover and ask information about the data they have access to.

## Before you begin

This task assumes you have placed the component on the page and are ready to configure the properties and events. For instructions on accessing and using features in UI Builder, see [Customize UI Builder pages using components](https://www.servicenow.com/docs/YMtTz79hYjmj5_kMcObIuA "Learn what a component is in UI Builder. Also, see how components work within UI Builder.").  
Note:  
This document describes the latest component functionality. Go to the store to make sure you have the latest version of the component.

If you have the Base Agent Workspace UX application, which is included in the base system, you have an Analytics Center page template. If you create a page using that template, it contains an Analytics Q\&A component. The events on this component have Link to destination Relay event handlers, which you use as a basis for Link to destination event handlers.  
Note:  
This component has no configurable properties. You can determine where to redirect query results by configuring the event handlers.

Role required: admin or ui_builder_admin

## Procedure

1. Define a label for your Analytics Q\&A component that differentiates it from other components in the content tree.  
   A label makes finding the component easier in a large list of components. For instructions on using the content tree, see [Manage UI pages and page variants](https://www.servicenow.com/docs/Hq7OFdFRjvDFnNsfdtsMGw "Learn what a page is in UI Builder. Understand the building blocks of a UI Builder page, such as column layouts and components.") .

   ![Content tree showing custom labeled Analytics Q&A component]()
2. Select the Analytics Q\&A component, using one of these methods:
   * Click anywhere within the component.
   * Select the Analytics Q\&A label you created for your component in the content tree.
   {#analytics-q-a-component-uib-setup__choices_t5b_vq4_pnb}
{#analytics-q-a-component-uib-setup__steps_s5b_vq4_pnb}

## Analytics Q\&A component properties {#ariaid-title2}

The Analytics Q\&A component doesn't have any user-configurable properties.

## Analytics Q\&A component events {#ariaid-title3}

Select event handlers to configure the actions (events) provided with the Analytics Q\&A component.
The Events tab shows the events used by the Analytics Q\&A component. To view the available events, select + Add event mapping. Select the event in the list to add one or more event
handlers.

### Event handlers {#analytics-q-a-config-events__section_ong_1xr_q5b}

Event handlers work with data resources to link the component actions to the data you want
to display to your users. Expand the event in the list and select Add an event handler. For information about event handlers, see [Configure an event handler](https://www.servicenow.com/docs/8s23OEG1s5oowl~vaOUlLw "Add an event handler to a page, component, data resource, or declarative action within UI Builder so that your user can trigger an action.") .

### Event descriptions {#analytics-q-a-config-events__section_jqn_bxr_q5b}

{#analytics-q-a-config-events__table_t5m_pt4_pnb__entry__2}

| Event | Description |
|-|-|
| Report visualization clicked | User selects a visualization based on table data from the results of "Ask a question about your data." Event handler: Link to Destination Suggested target component: List |
| Indicator visualization clicked | User selects an indicator visualization from the results of "Ask a question about your data." Event handler: Link to Destination Suggested target component: KPI Details |
| List item clicked | User selects column data from the results of "Ask a question about your data." Event handler: Link to Destination Suggested app route: A page configured to show records |
| Ask button clicked | Hides other components on page when user asks for query results. Event handler: A script you write to hide the components on the page. To restore the components, configure the "Back button clicked from NLQ Results page" event. |
| Back button clicked from NLQ Results page | Restores components hidden by "Ask button clicked" when user selects to go back from the query results. Event handler: A script you write to restore the components on the page, reversing the results of the script you wrote for "Ask button clicked." For an example of script for both events, see Show Analytics Q\&A results in full page. |
[ ]

{#analytics-q-a-config-events__table_t5m_pt4_pnb}

### Linking Report Visualization Clicked event to List component {#analytics-q-a-config-events__section_fps_kdt_v4b}

Set the following properties to link the Report Visualization Clicked event in an Analytics Q\&A component to the suggested List component. You can link to a different component if that component takes a subset or none of the properties listed here. To link one component to another, follow these broad steps:

1. Create the page that will hold the target component.
2. Add the required and optional parameters to that page.
3. Add the List component to the page.
4. Configure the List component with the properties.
5. In the linking component, add a Link to destination event handler to the linking event.
6. In the destination of the event handler, select an app route to the page that holds the target component.
7. Configure the event handler properties.
{#analytics-q-a-config-events__ol_mjy_b2t_v4b}  
Tip:  
If you have the Platform Analytics Workspace, which is included in the base system, you have a Simple List page template. You can create a page in your application using this template. Only copy the contents of the page. The component config properties are populated. You have to add the required and optional page parameters. Also configure the relevant event handler on the Analytics Q\&A component to link to this page.  
{#analytics-q-a-config-events__table_x2b_dct_v4b__entry__3}

| Parameters on page containing List | Value of corresponding Config fields on List | Link to Destination event handler properties |
|-|-|-|
| table (required) | @context.props.table | @payload.table |
| listTitle (optional) | @context.props.listTitle | @payload.listTitle |
| query (optional) | @context.props.query | @payload.query |
| disableInlineEditing (optional) | @context.props.disableInlineEditing | None |
[ ]

{#analytics-q-a-config-events__table_x2b_dct_v4b}

In the following example, the Link to Destination event handler for a Report Visualization Clicked event is configured to link to a page with the route /simplelist. That page contains a List component.

### Linking Indicator Visualization Clicked event to KPI Details component {#analytics-q-a-config-events__section_rmd_lft_v4b}

Set the following properties to link the Indicator Visualization Clicked event in an Analytics Q\&A component to the suggested KPI Details component. You can link to a different component provided that component takes a subset or none of the properties
listed here. To link one component to another, follow the broad steps in the "Linking Report Visualization Clicked event to List component" section of this topic.  
Tip:  
If you have the Base Agent Workspace UX application, which is included in the base system, you have a KPI Details page template. You can create a page in your application using this template. Only copy the contents of the page. The component config properties are populated. You have to add the required and optional page parameters. Also configure the relevant event handler on the Analytics Q\&A component to link to this page.  
{#analytics-q-a-config-events__table_ejr_smt_v4b__entry__3}

| Parameters on page containing KPI Details | Value of corresponding Config fields on KPI Details | Link to Destination event handler properties |
|-|-|-|
| uuid (required) | @context.props.uuid | @payload.indicatorSysid |
| scoreDate (optional) | @context.props.scoreDate | @payload.scoreDate |
| breakdown (optional) | @context.props.breakdown | @payload.breakdowns |
| domain (optional) | @context.props.domain | @payload.domain |
[ ]

{#analytics-q-a-config-events__table_ejr_smt_v4b}

In the following image, the Link to Destination event handler for an Indicator
Visualization Clicked event is configured to link to a page with the route ac_kpi_details,
which contains a KPI Details component.

### Linking List Item Clicked event to page showing records {#analytics-q-a-config-events__section_kqz_jqt_v4b}

Set the following properties to link the List Item Clicked event in an Analytics Q\&A component to open a record. You do not link to one specific component for displaying a record. Instead, link to a page that is set up with scripts and visual
subcomponents to display records. Some properties are also passed to some components, such as Record tabs.  
Tip:  
If you have the Base Agent Workspace UX application, which is included in the base system, you have a Record page template. You can create a page in your application using this template. Only copy the contents of the page. The component config properties are populated. You have to add the required and optional page parameters. Also configure the relevant event handler on the Analytics Q\&A component to link to this page.  
{#analytics-q-a-config-events__table_list-item-clicked__entry__3}

| Parameters on Record page | Config properties on Record Tab and other components, such as Header | Link to Destination event handler properties |
|-|-|-|
| table (required) | @context.props.table | @payload.table |
| sysid (required) | @context.props.sysId | @payload.row.sys_id.value |
| query (optional) | None | @payload.breakdowns |
| extraParams (optional) | None | @payload.domain |
| views (optional) | None | None |
| selectedTabIndex (optional) | @context.props.selectedTabIndex (Record tab only) | None |
| None | None | @payload.row.name.value |
[ ]

{#analytics-q-a-config-events__table_list-item-clicked}

In the following image, the Link to Destination event handler for a List Item Clicked event
is configured to link to a page with the route /record. The title for the records page is
passed in `@payload.row.name.value`.
Figure 1. List Item clicked
**Related tasks**   

* [Create a page in UI Builder](https://www.servicenow.com/docs/g6E17XDJVu4Y3lgE_R2LZw "Create a page in UI Builder for a portal, workspace, or custom application so that you can build a web experience for your users.")

## Show Analytics Q\&A results in full page {#ariaid-title4}

Set up Analytics Q\&A so that when your users ask a question, they see only the results and not the other components on the page. They see the other components again when they navigate
back.

### Before you begin

This procedure assumes you have a page with an Analytics Q\&A component and other components.

Role required: None

### About this task

For Analytics Q\&A results to appear in a full page, create the following items:

* A client state parameter for whether full page is enabled
* A client script to make the results appear in a full page
* A client script to reset the page to show all components
{#hide-other-components__ul_llb_ygb_x4b}

Then you configure the Analytics Q\&A component to use these scripts. Lastly, configure the other components on the page to be hidden or not according to the state parameter.  
Tip:  
If you have the Base Agent Workspace UX application, which is included in the base system, you have an Analytics Center page template. If you create a page using that template, it contains an Analytics Q\&A component that is set up to show the results in full-page format.

### Procedure

1. Navigate to your experience and open it in UI Builder.
2. Open the relevant page that has an Analytics Q\&A component.
3. Open the Client state menu from the icon in the bottom-left margin.  
   ![Client state icon with tooltip]()
4. Create a Boolean parameter with a meaningful name and no initial value.  
   In this example, you have named the parameter nlq_results_full_page. You use the default code:

       {
         "nlq_results_full_page": false
       }

5. Open the Client scripts menu from the icon in the bottom-left margin.  
   ![Client scripts icon with tooltip.]()
6. Create a script with a meaningful name that sets the value of the state parameter you created to `true`.  
   In this example, you have named the script Set NLQ Results Full Page. The script sets the nlq_results_full_page parameter to `true`:

       /**
        * @param {params} params
        * @param {api} params.api
        * @param {any} params.event
        * @param {any} params.imports
        */
       function handler({api, event, helpers, imports}) {
       	api.setState('nlq_results_full_page', true);
       }

7. Create a script with a meaningful name that resets the value of the state parameter to `false`.  
   In this example, you have named the script Reset NLQ Results Full Page View. The script sets the nlq_results_full_page parameter to `false`:

       /**
        * @param {params} params
        * @param {api} params.api
        * @param {any} params.event
        * @param {any} params.imports
        */
       function handler({api, event, helpers, imports}) {
       	api.setState('nlq_results_full_page', false);
       }

8. Select the Analytics Q\&A component and open the Events tab.
9. Expand the Ask button clicked event and select + Add a new event handler.
10. Select the script you created that sets the state parameter to `true` and select Apply.  
    In this example, you have selected the Set NLQ Results Full Page script.

11. Expand the Back button clicked from NLQ Results page event and select + Add a new event handler.
12. Select the script you created that sets the state parameter to `false` and select Apply.  
    In the example, this script is Reset NLQ Results Full Page View.
13. For each of the remaining components, follow these steps:
    1. Select the component.
    2. Click the Edit component visibility icon above the config panel.  
    3. At the Hide component field, select the Data icon.
    4. Browse for the client state parameter that you created.  
       This parameter has the `@state` prefix.  
       In the example, the client state parameter is named nlq_results_full_page, so the field value is <kbd class="ph userinput">@state.nlq_results_full_page</kbd>.

    {#hide-other-components__substeps_igx_ynb_x4b}

### What to do next

You can look at a fully configured Analytics Q\&A component in the Base Agent Workspace experience, included in the base system.

