Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Syntax for flow designer record lookup script

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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

15 REPLIES 15

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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

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  ||  10x 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.