Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Syntax for flow designer record lookup script

Community Alums
Not applicable

Hi , 

I want the below encoded query to be added in record lookup for my flow designer.

What is the syntax for adding encodedquery in lookup record -

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

I am updating it

return

"active=true^due_date<javascript:gs.beginningOfToday()^assigned_toISNOTEMPTY^parent.closed_by.managerSAMEASassigned_to"

Please mark my response as correct

Regards
Ankur

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

View solution in original post

15 REPLIES 15

Community Alums
Not applicable

Hi Raghu , 

not working like this.

 

Can we write script for lookup records , if yes , what should be the syntax.

 

Thanks,

Gaurav Tyagi

 

@gaurav tygai 

I already shared above

sharing again here

"active=true^due_date<javascript:gs.beginningOfToday()^assigned_toISNOTEMPTY^parent.closed_by.managerSAMEASassigned_to"

find_real_file.png

 

Regards
Ankur

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

Community Alums
Not applicable

Hi Ankur ,the above script worked but after adding return to it it should be -

return "query" ;

Marking your answer as correct.

 

Thanks,

Gaurav Tyagi

I am updating it

return

"active=true^due_date<javascript:gs.beginningOfToday()^assigned_toISNOTEMPTY^parent.closed_by.managerSAMEASassigned_to"

Please mark my response as correct

Regards
Ankur

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

Hi @Gaurav Tyagi 

Create glide record like below code... and change your encoded query according to urs and try it.

var gr = new GlideRecord('sc_task');
gr.addEnocdedQuery('active=true^short_descriptionSTARTSWITHtest');
gr.query();
while(gr.next())
{
return gr;
}

I hope it definetly helps you, please mark my response as correct and helpful.