---
sourceDocument: Australia Customer Service Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/customer-service-management

 Release :

    - australia

ft:locale :

    - pt-BR

ft:publication_title :

    - Australia Customer Service Management

ft:clusterId :

    - csm

bundleId :

    - csm

workflow :

    - Customer and Industry


---

# Modify view in the Data List widget

# Modify view in the Data List widget {#ariaid-title1}

* Versão de lançamento: Australia
* 
* Atualizado 12 de mar. de 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 min. de leitura

Create a condition script to modify views in the Portal Data List widget.

## Antes de Iniciar

The UI Components for Customer Portals plugin must have been activated. For more information, see [Activate the UI Components for Customer Portals plugin](https://servicenow-prod.fluidtopics.net/dbhRuP7sSuHV4JpVf6YfsQ "You can activate the UI Components for Customer Portals plugin (sn_ciwf_ui_cmpnt) to enable Configurable Portal widgets. The application installs related plugins if they aren’t already installed.")

Role required: sp_admin

## Por Que e Quando Desempenhar Esta Tarefa

{#update-view-in-datalist-widget__table_k4r_1s5_c3c__entry__3}

| Priority | Source | Description |
|-|-|-|
| 1 (Highest) | Script | If a Views Condition Script is configured and returns a view name, that view is used. Scripts have the most flexibility since they can apply custom logic using the parameters - `categoryId`, `params`. |
| 2 | role_based_views / guest_view | If no script is configured or the script doesn't return a view, the system checks the JSON instance options. * For logged-in users, it checks `role_based_views` to find a view matching the user's roles. * For non-logged-in users, it uses `guest_view` {#update-view-in-datalist-widget__ul_lnt_h55_c3c}. |
| 3 | view | The widget uses the view JSON instance option if the script or role based view/guest view mappings doesn't apply. |
| 4 (Lowest) | Default View on Platform | If no other configuration applies, the widget uses the platform's default view for the table. |
[Tabela 1. Priority order for how the Data List widget determines the view]

{#update-view-in-datalist-widget__table_k4r_1s5_c3c}

## Procedimento

1. Navigate to AllSystem Extensions PointsScripted Extensions Points.
2. On the Extension Points page, in the API Name column search field, enter <kbd class="ph userinput">*datalist</kbd>.
3. Select the sn_ciwf_ui_cmpnt.DatalistCategoryConditionScript in the API Name column.  
   If a message appears about the application scope, select here to be able to edit the record.
4. On the DatalistCategoryConditionScript page, in the Related links, select Create implementation.
5. In the Script field, paste the following CSS code:  


       getView: function(category_id, params) {
           return "case"; // view
       }

   {#update-view-in-datalist-widget__table_r5r_kyx_13c__entry__2}

   | Parameters | Description |
   |-|-|
   | category_id | Portal Data list category id. |
   | params | JSON containing url_params and related_table. For example, { "url_params": { "table": "customer_contact", "sys_id": "60beb5e7d7600200e5982cf65e6103ad", "view": "sp" }, "related_table": "sn_customerservice_case" } |
   [Tabela 2. Function parameters]

   {#update-view-in-datalist-widget__table_r5r_kyx_13c}
6. Copy the name of a condition script from the Name field.
7. Select Update.
8. Navigate to your portal home page.
9. On the Data List widget, press Control+right-click.
10. Select Instance Options.
11. In the Behavior section, paste the name that you copied into the Data List condition script field.
12. Select the condition script from the list.
13. Select Save.
{#update-view-in-datalist-widget__steps_vdd_qkx_d3c}

