Can someone help me to use the query result?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2022 11:25 AM
Hi Everyone!
So, I have this script I've been trying to fix this to use the result of the query but it prints the whole table.
I want to use only que result of the query and print it, but idk if I should use another glideRecord or maybe a getQuery or something like that.
(function runMailScript(template, current, email, email_action, event) {
var tb = new GlideRecord ('sys_store_app');
tb.addQuery('sys_mod_countISNOTEMPTY');
tb.query(); // execute query
while (tb.next()){
template.print('Name: ' + tb.name + '\n');
}
})(template, current, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2022 11:31 AM
Hi,
Normally sys_mod_count wouldn't ever be empty. Are you meaning to search for it when it equals 0?
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2022 12:36 PM
Hi!
I want to display all the apps that need to be updated, but I'm not sure on how to do it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2022 09:28 AM
Hi,
This will scan the entire table and compare the versions:
var grStoreApp = new GlideRecord ('sys_store_app');
grStoreApp.query();
while(grStoreApp.next()){
if(grStoreApp.version != grStoreApp.latest_version && grStoreApp.version<grStoreApp.latest_version){
gs.info(grStoreApp.name+' v:'+grStoreApp.version+' latest:'+grStoreApp.latest_version)
}
}
I've used gs.info so that you can run this in a background script and see the output. The gs.info will produce a string in the following format:
Name of Plugin + Current Version + Latest Version