Hi,

yes it can still be done till the point you are using the target table's field during the query in your script

sample script:

if(gs.getUser().isMemberOf('Group 1')){

current.addQuery('u_requester', gs.getUserID());

}

if(gs.getUser().isMemberOf('Group 2')){

current.addQuery('u_on_behalf_of ', gs.getUserID());

}

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader