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.

About Encoded Query with sys_created_on

Gayathri5
Tera Guru

Hi all,

 

I am trying to add Encoded query  with sys_created_on before 24th jan

gr.addEncodedQuery('state!=3^assignment_group=207449d2dbae7700a1385d87f49619d4^active=true^sys_created_on<javascript:gs.dateGenerate('2022-01-24','00:00:00')');

I am getting parsing error, unexpected token 2022. Can any1 help me how to resolve this parsing error?

 

Regards,

Gayathri

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

Hi,

use double quotes here

gr.addEncodedQuery("state!=3^assignment_group=207449d2dbae7700a1385d87f49619d4^active=true^sys_created_on<javascript:gs.dateGenerate('2022-01-24','00:00:00')");

you can form the query on table list and then copy that query

find_real_file.png

Regards
Ankur

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

View solution in original post

1 REPLY 1

Ankur Bawiskar
Tera Patron

Hi,

use double quotes here

gr.addEncodedQuery("state!=3^assignment_group=207449d2dbae7700a1385d87f49619d4^active=true^sys_created_on<javascript:gs.dateGenerate('2022-01-24','00:00:00')");

you can form the query on table list and then copy that query

find_real_file.png

Regards
Ankur

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