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

Gontla Mythily
Tera Expert

Hi,

 

You can filter on list view and copy  query.

GontlaMythily_0-1667390241635.png

gr.addEncodedQuery("assignment_group=8a4dde73c6112278017a6a4baf547aa7^ORassignment_group=d625dccec0a8016700a222a0f7900d06^ORassignment_group=725eb7f4db9532000454f1351d96198c");

 

 

Mark as correct if it helps
Regards Mythily

RaghavSh
Kilo Patron

It should be like this:

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

 

after ^ORgroup=  you can add second sys_id and so on.....

Make sure group is the backend name of your field, it could be assignment_group because all OOB group field's name is assignment_group


Raghav
MVP 2023

Hi ,

When adding the 3 group not working but when adding one group in the encoded query working fine.

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

make the below changes also make sure group and user are the backend names of the fields you are referring from the table, also the user and group fields should be reference fields as you are passing sys_id in your query

 

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


Raghav
MVP 2023