Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
The Search option available under Cloud User Portal is not useful to search specific stack information. - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • The Search option available under Cloud User Portal is not useful to search specific stack information.
KB0696874

The Search option available under Cloud User Portal is not useful to search specific stack information.


547 Views Last updated : Jul 24, 2025 public Copy Permalink
KB Summary by Now Assist

Issue

Symptoms


The Search option available under Cloud User Portal is not useful to search specific stack information.

The customer might have multiple stacks available under Manage Stacks section in Cloud User Portal, current search option available is Global, given a stack name to search, the search looks at global available with a specific name but not really serving the need to search only for Stacks or Resources.

Release


Jakarta P*, Kingston P* and London

Environment


Cloud User Portal (CMP) 

Cause


The code currently not supporting the Search option in Cloud User Portal to filter specific information. 

Resolution


While Development is working to update the Search option feasibility for the customer, we can use below workaround which could make the Search option with more relevant information, below is the procedure to modify the search option for stacks.

  1. Log into the instance
  2. Navigate to Service Portal > Search Sources
  3. Filter on the Name field for "Stacks"
  4. Replace the Data fetch script section as below.

 

(function(query) {
var results = [];

if (!gs.isLoggedIn())
return results;

var userRoles = gs.getUser().getUserRoles();
var is_admin = false;
var is_group_admin = false;

if(!gs.nil(userRoles)) {
if(userRoles.indexOf('admin')>-1 || userRoles.indexOf('sn_cmp.cmp_root_admin')>-1)
is_admin = true;
if(userRoles.indexOf('sn_cmp.cloud_group_admin')>-1)
is_group_admin = true;
}

var view = gs.getUser().getPreference('cloud_user_portal_view') || 'mine';

var group_ids = [];

if(is_group_admin || is_admin) {
var grm_rec = new GlideRecord('sys_user_grmember');
grm_rec.addQuery('user',gs.getUserID());
grm_rec.query();
while(grm_rec.next())
group_ids.push(grm_rec.group.sys_id);
}

var sc = new GlideRecord('sn_cmp_stack');

if(view == 'mine')
sc.addEncodedQuery('assigned_to='+gs.getUserID());
else if(view == 'group' && (is_admin || is_group_admin))
sc.addEncodedQuery('assigned_to='+ gs.getUserID()+'^ORowner_groupIN'+ group_ids.join(','));

sc.addQuery("name","STARTSWITH",query);
sc.query();
while (sc.next()) {
if (!$sp.canReadRecord(sc))
continue;

var item = {};
item.name = sc.getDisplayValue("name");
item.sys_id = sc.getUniqueValue();
item.url = "?id=cloud_stack_details&category=cloud_stacks&sys_id=" + sc.getUniqueValue() + "&selected_card="+ sc.getUniqueValue() +"&spa=1&active_tab=changeRequests";
item.primary = item.name;
results.push(item);
}

return results;
})(query);

 

Once above code has been replaced, we could observe the Search in Manage stacks page provide filtered information.  

Additional Information


This is a temporary workaround which could be replaced in future releases.


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.