Database View to query Assessment Tables in ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2018 09:22 AM
Hi,
I'm trying to create a database view on Assessment Tables to get a complete report. Here is the view snapshot that I'm using. When I run the report, I'm able to view records from the highlighted tables. But unable to fetch data from asmt_metric_category and asmt_category_result table. Any help would be appreciated.
x_usaa3_sec_saas_security is a custom table.
- Labels:
-
Scoped App Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2018 09:48 AM
- From the Database View form, click New on the View Tables related list.
- Configure the form and add the Left join field (a check box) to the form.
- Click Save.
- Complete the form and select the Left join check box.
- Selecting Left join causes the left-hand table in the database view to display all records, even if the join condition does not find a matching record on the right-hand table. Select this check box for view tables that specify a Where clause. Selecting Left join for view tables without a Where clause does not affect the query.
- Joined tables are ordered left to right from lowest to highest Order values.
- Click Submit.
- Personalize the View Tables related list to show the Left join column.
The Left join field shows a value of true.
- Click a record to view a table.
The View Table form appears.
- To add an OR to your where clause use ||.
For example, to query all incidents related to RFCs OR all incidents that are the parent of a change request, use the following syntax:
inc_rfc = chg_sys_id || chg_parent = inc_sys_id
-------
A property called glide.db.max_view_records controls the maximum number of rows returned when running a GlideRecord query in a script. The default value for this property is 10,000. To change this value, add the property to the System Property [sys_properties] table and edit the number of rows to return.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2018 10:27 AM
Thank you for your response. I have done the left join too. But unable to derive the exact result that I'm looking for. Data is not being fetched for these two table. asmt_metric_category and asmt_category_result.
Anyone who has created a DB view on assessment tables?