How to add 2 more group sys ID in the encoded query below?

sruthig
Tera Expert

How to add 2 more group sys ID in the encoded query below?

I want to add 2 group sys_id in the encoded query. How to add in this same encoded query string?

 

gr.addEncodedQuery('group=a65710533505ef4006ef3c755775edfr' + '^user=' + loggedinUser);

 

Regards,

sruthi

 

 

7 REPLIES 7

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @sruthig ,

 

Can you try below encoded query :-

You missed one single quote after last group sys id.

gr.addEncodedQuery('group=f8970533505ef4006ef3c755775eafgt^ORgroup=y6570533505ef4006ef3c755775etyg^ORgroup=88aa717e1b115d904519cddf034b22cb '+ ' ^ user = ' + loggedinUser);

 

Regards,

Gunjan Kiratkar


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

Rudra3
Tera Contributor

Hi, @sruthig

Please try the below code in the background script:- 

var incident=new GlideRecord('incident');
incident.addEncodedQuery('assignment_group=e45d9ebc3b333200fe02c9bb34efc434^ORassignment_group=d625dccec0a8016700a222a0f7900d06');
incident.query();
if(incident.next()){
    gs.info('incident Count=='+incident.getRowCount());
}

Abhijit4
Mega Sage

I  see the problem with your sys_ids below :

 

gr.addEncodedQuery('group=f8970533505ef4006ef3c755775eafgt^ORgroup=y6570533505ef4006ef3c755775etyg^ORgroup=88aa717e1b115d904519cddf034b22cb + ' ^ user = ' + loggedinUser);

 

f8970533505ef4006ef3c755775eafgt,y6570533505ef4006ef3c755775etyg - > sys_id only include hexa decimal characters but why you have 'g', 't', 'y' characters in sys_id, also your sys_id length is more than 32 character which is wrong so please make sure you are using correct group sys_id.

 

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP