sow ui builder overview page show only in incident table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 01:02 AM
hii,
Hi, I'm working on the service operation workspace, and I want the overview page to be displayed with the incident section only . How can I hide it from the rest of the tables? Automatically, it appears in all of them. Adding an image showing that the conditions are not working. Conditions for page settings. Thanks to everyone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 05:36 AM
Hi @Dolev Peretz ,
It is possible. There are couple of things you need to do.
1. Duplicate the overview variant as it is stated in documentation.
2. Now, you need the incident sysId first to query the state. This is mapped in page properties. You can use this to query the incident state via data sources.
3. Create a state parameter to specify the fields to query. Here we want to query state.
4. Click on data sources icon and Add a data source of type- "Look Up Record". Map the properties as below.
5. As the data source is triggered immediately. The output would be available to you on page load in below format.
{
"_row_data": {
"displayValue": "INC0010007",
"uniqueValue": "b2c7e2f52faca1101dc093acf699b682"
},
"number": {
"value": "INC0010007",
"displayValue": "INC0010007"
},
"state": {
"value": "1",
"displayValue": "New"
}
}
You can access this output via: api.data.look_up_record_1.result.state.value in scripts.
This can be used in your component's hidden property like below.
6. Click on the component you want to hide. Add below script to the property.
/**
* @Param {params} params
* @Param {api} params.api
* @Param {TransformApiHelpers} params.helpers
*/
function evaluateProperty({api, helpers}) {
if(api.data.look_up_record_1.result.state.value == 1) //If state=1
return true; //Hide the component
else
return false; //Do not hide the component
}
Also, if you want to execute this only for incident table then add another condition in IF statement to check the table also.
/**
* @Param {params} params
* @Param {api} params.api
* @Param {TransformApiHelpers} params.helpers
*/
function evaluateProperty({api, helpers}) {
if(api.data.look_up_record_1.result.state.value == 1 && api.context.props.table == "incident")
return true; //Hide the component
else
return false; //Do not hide the component
}
Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.
Thanks
AJ
Linkedin Profile:- https://www.linkedin.com/in/ajay-kumar-66a91385/
ServiceNow Community Rising Star 2024
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 11:55 PM
Hi ,
Thank you,
in steps 6 where i need to add the script for hide?
On the roof that it doesn't work in this