{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":7086,"path":"customer-service-management/portal-datalist-widget-data-json.md","title":"Portal Data List widget JSON parameters","bundle":null,"doc_type":null,"release":"australia","body":"\n# Portal Data List widget JSON parameters\n\nJSON parameters define aspects of the Portal Data list widget on the portal page.\n\n**Note:** This information assumes that you’re familiar with the JSON code format.\n\n<table id=\"table_csm_base_entities\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncategories\n\n</td><td>\n\nEach category displays a set of records from the Customer Case View Case \\[sn\\_customerservice\\_case\\] table that meets the filter criteria.For each category, you can choose from pre\\_defined\\_filters and run\\_time\\_filters predefined filter tabs, set the columns for the list view, and determine the fields to be shown in the card view.\n\n</td></tr><tr><td>\n\nID\n\n</td><td>\n\nA unique identifier that enables the categories condition script to determine whether to show or hide categories on the widget.\n\n</td></tr><tr><td>\n\nlabel\n\n</td><td>\n\nName of the category that appears on the navigation pane.If a label isn’t entered, the category doesn't appear.\n\n</td></tr><tr><td>\n\ntable\n\n</td><td>\n\nThe table from which the records are shown on the widget when a category is selected.By default, this field is set to the Case \\[sn\\_customerservice\\_case\\] table.\n\n</td></tr><tr><td>\n\nlist\\_view\n\n</td><td>\n\nThe name of the view that defines the list of columns or fields to appear on the widget.For more information on these views, see [Create and delete views](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-user-interface/create-delete-view.md).\n\nIf no value is provided, all columns are shown.\n\n</td></tr><tr><td>\n\ncard\\_view\\_primary\\_column\n\n</td><td>\n\nA field from the defined table to be displayed in the first column of a card. For example, you can show the case number in the first column.\n\n</td></tr><tr><td>\n\ncard\\_view\\_secondary\\_column\n\n</td><td>\n\nA field from the defined table to be displayed in the second column of a card. For example, you can show short description of the case record.This parameter is optional.\n\n</td></tr><tr><td>\n\ncard\\_view\\_additional\\_columns\":\"column1\\|column2\\|column3\\|column4\n\n</td><td>\n\nField pairs from the defined table to be displayed as additional columns of a card.You can add a maximum of four additional columns.\n\nThis parameter is optional.\n\n</td></tr><tr><td>\n\nquery\":\"active=true\"\n\n</td><td>\n\nQuery to filter the records that display under the category.If no value is provided, all records are displayed.\n\n</td></tr><tr><td>\n\nglyph\":\"glyph\\_name\"\n\n</td><td>\n\nThe glyph to appear on the left of the category label in the navigation pane. The glyph name provided should be from the font-awesome library, which can be accessed at the following URL:\n\n```\nhttps://fontawesome.com/v4/icons/\n```\n\nThe currently supported version of the font-awesome library is v4.7. If you use a glyph name from a different version, the image will not appear correctly.\n\n**Note:** If both a glyph and an image are defined, the image is displayed.\n\nThis parameter is optional.\n\n</td></tr><tr><td>\n\n\"image\\_name\":\"file\\_img\"\n\n</td><td>\n\nAn image to appear on the left of the category. The image name should be selected from the Images \\[db\\_image\\] table.\n\n**Note:** If both a glyph and an image are defined, the image is displayed.\n\nThis parameter is optional.\n\n</td></tr><tr><td>\n\nrecord\\_view\\_page\n\n</td><td>\n\nThe Service Portal that displays the page with details of any record accessed in the widget.This parameter is optional.\n\nBy default, this field is set to the Case \\(csm\\_ticket\\) page.\n\n</td></tr><tr><td>\n\ntarget\\_page\n\n</td><td>\n\nThe page to which users are redirected when they select a record in the widget. You can specify either a page name or a full dynamic URL that resolves the target page, table, and record at runtime based on the record type.Example: `\"target_page\": \"portal_contact\"`\n\nFull dynamic URL — Generates the URL at runtime based on the record type. Use the following formats depending on the type of record:\n\n-   Referenced \"target\\_page\": `\"id=example_page_id&table={reference_field.sys_class_name}&view=example_view_name\"`\n-   Child \\(extended\\) table \"target\\_page\":`\"id=example_page_id&table={sys_class_name}&view=example_view_name\"`\n-   Parent table \"target\\_page\": `\"id=example_page_id&table=parent_table&view=example_view_name\"`\n-   Same table \"target\\_page\": `\"id=example_page_id\"`\n\nIf both `target_page` and `target_page_id` are configured, `target_page` takes precedence.\n\n**Note:** This parameter is optional. If neither `target_page` nor `target_page_id` is configured, the widget falls back to the value defined in `record_view_page`.\n\n</td></tr><tr><td>\n\npre\\_defined\\_filters\"filter\\_name\":\"Value\",\n\n</td><td>\n\nDisplay cases which are in New, Closed, Open, or Awaiting Info state in any selected category. These filters appear as tabs in the widget. Only Open and Closed case are included by default in the JSON code. The available values are:-   filter\\_name: Name of the filter tab\n-   Value: Name of the case state such as New, Closed, Open, or Awaiting Info.\n\nThis parameter is optional.\n\n</td></tr><tr><td>\n\nrun\\_time\\_filters\n\n</td><td>\n\nDisplays column and its fields from the defined table as runtime filters in a drop-down list. These runtime filters filter the case records displayed in the widget based on different fields from the defined table. For example, you can display Priority as a column and State, Contact, or Updated as fields. If the runtime filters values are not provided in the column and selection\\_type parameters, the filter icon will not appear for the category.\n\nThis parameter is optional.\n\n</td></tr><tr><td>\n\nselection\\_type\n\n</td><td>\n\nDisplay the type of selection. The available options are:-   Single select: Single selection for the filter column\n-   Multi select: Multiple selection values for the filter columns\n\n</td></tr><tr><td>\n\nvalues\"value\":\"4\"\n\n</td><td>\n\nValues from the defined table for the column parameter. The available values are:-   Label: Name of a value\n-   Value: Integer value of a field\n\n</td></tr><tr><td>\n\n\"ranges\":\"label\":\"Last Month\", \"query\":\"&lt;Range condition&gt;\",\n\n</td><td>\n\nUsed to filter the records using a query defined in label and query parameters. For example, you can display case records that have been updated in the last month, last 3 months, or last 6 months.The range configuration is:\n\n-   Label: Name of the filter option\n-   Query: Query that defines a set of values grouped under a label\n\nThis parameter is optional.\n\n</td></tr><tr><td>\n\n```\n\"role_based_views\":\n{\n\"field_service_agent_view\":\"snc_field_technician\",\n\"agent_case_view\":[\"snc_customer_service_agent\",\"snc_manager\"]\n}\n```\n\n</td><td>\n\nUsed to display data list according to the role of the logged in user. List the roles in an array to map multiple roles to the same view. All roles in that array share the same view.\n\nFor example, if you want both support agents and service managers to see the same case view, assign the same view \\(such as `\"agent_case_view\"`\\) to both roles within an array.\n\nWhen a user has multiple roles the system uses the first matching view it finds.\n\nThis parameter is optional.\n\n</td></tr><tr><td>\n\n\"guest\\_view\":\"viewname\n\n</td><td>\n\nUsed to display items for guest users or not logged in users. Map the view you want to display for the guest users.To make the items available to guest users, you must set these to public:\n\n-   Portal Data List widget.\n-   Page containing widget \\(For example, Cases and Tasks\\)\n-   Page content instance\n\nFor details, see [Configure public access on the Portal Data List widget](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/customer-self-service-and-omnichannel-engagement/config-data-list-widget-inst-guest-access.md).\n\nThis parameter is optional.\n\n</td></tr><tr><td>\n\n\"sort\\_by\":\"&lt;column name&gt;\"\n\n</td><td>\n\nUsed for first‑load sorting of Data List.This parameter is optional.\n\n</td></tr><tr><td>\n\n\"sort\\_order\":\"&lt;asc/desc&gt;\"\n\n</td><td>\n\nOrder of sorting the data list. Default is ascending.This parameter is optional.\n\n</td></tr></tbody>\n</table>**Related topics**  \n\n\n[Add and configure the Portal Data List widget](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/customer-self-service-and-omnichannel-engagement/config-data-list-widget-inst-optns.md)\n\n"}}