Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Modify view in the Data List widget

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

Before you begin

The UI Components for Customer Portals plugin must have been activated. For more information, see Activate the UI Components for Customer Portals plugin

Role required: sp_admin

About this task

PrioritySourceDescription
1 \(Highest\)ScriptIf 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`.
2role\_based\_views / guest\_viewIf 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` .
3viewThe 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 PlatformIf no other configuration applies, the widget uses the platform’s default view for the table.

Procedure

  1. Navigate to All > System Extensions Points > Scripted Extensions Points.

  2. On the Extension Points page, in the API Name column search field, enter *datalist.

  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
    }
    
ParametersDescription
category\_idPortal Data list category id.
paramsJSON containing url\_params and related\_table. For example,
{
  "url_params": {
    "table": "customer_contact",
    "sys_id": "60beb5e7d7600200e5982cf65e6103ad",
    "view": "sp"
  },
  "related_table": "sn_customerservice_case"
}
  1. Copy the name of a condition script from the Name field.

  2. Select Update.

  3. Navigate to your portal home page.

  4. On the Data List widget, press Control+right-click.

  5. Select Instance Options.

  6. In the Behavior section, paste the name that you copied into the Data List condition script field.

  7. Select the condition script from the list.

  8. Select Save.