Setting view when record is accessed from list view

samadam
Kilo Sage

I am trying to default a view to testview for incident when access from a list. I tried to create view rule as follows but is doesn't work. Any ideas?

samadam_0-1730655450634.png

 

 

3 REPLIES 3

B_Engelstock
Tera Expert

You are missing the { and } characters.

if ( -criteria-) {

do this

}else{

do something else

}

dhanrajb
Tera Guru

Hi @samadam ,

 

Is that view name correct? Cross verify the name of view in "sys_ui_view" table. I believe that will fix the issue.

 

Regards,

Dhanraj.

Runjay Patel
Giga Sage

Hi @samadam ,

 

You can use below script.

 if (is_list)
        answer = 'your view name';
    else
        answer = null; 

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

Here in this Video, I have covered the Custom Application Pattern Troubleshooting and configuration Thank you for visiting my channel. Here, I'll share various technical knowledge. Feel free to reach out to me directly for any Service Now-related queries. Your support encourages me to consistently