- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2018 11:28 PM
Hi All,
can anyone guide me how to write filter conditions for this " records created today and records created by sujith" in script?
Thanks,
sujitha
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2018 11:38 PM
Here is the filter and make sure change the user id according to the sys_user table.
Once you are done with below filters copy the query from filter list and add to the script
gr. addEncodedQuery('sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^sys_created_by=javascript: gs.getUserName()')
Note: It always gives only the records created today and created by the user name we provide.
If you are looking for the created by user dynamic based on the logged in user use below filter conditions (javascript: gs.getUserName())
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2018 11:38 PM
Here is the filter and make sure change the user id according to the sys_user table.
Once you are done with below filters copy the query from filter list and add to the script
gr. addEncodedQuery('sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^sys_created_by=javascript: gs.getUserName()')
Note: It always gives only the records created today and created by the user name we provide.
If you are looking for the created by user dynamic based on the logged in user use below filter conditions (javascript: gs.getUserName())
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2018 11:41 PM
Hi Sujith,
You can user 'addEncodedQuery()' into your script as mention below.
var gr = new GlideRecord("tableName");
gr.addEncodedQuery(sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^sys_created_bySTARTSWITHSujith);
gr.query();
Please mark answer correct and helpful if it served your purpose.
Warm Regards
Nikhil Dixit
| www.DxSherpa.com |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2018 11:42 PM
Hi,
You can write like this
gr.addEncodedQuery('sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^sys_created_by=sujith');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2018 11:44 PM
Hi Sujitha,
Glide your table (eg - Incident)
var gr = new GlideRecord("incident");
gr.addEncodedQuery("sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^sys_created_by=sujith");
gr.query();
while(gr.next())
{
//do something
}
Thankyou