How to query a table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 02:13 AM
Hello Experts,
I have a table with 3 columns
Group
Support Email
Urgent Email
I want to Query the table based on Group i need to set the remaining two fields (Support n Urgent)
For ex if Group is hr, i want hr.support@xx.net and hr.urgent@xx.net in corresponding fields...
it is possible through glide query, so which condition i need to write here.
Can you please give some idea.
Regards,
Ganesh.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 02:19 AM
Hi Ganesh,
You can write a before BR and fetch the value of group like
var grp =current.u_group.name; //This will give group name selected.Here I am assuming u_group is the column name of the field.
Based on this value you can set the other fields like
current.u_support_email = 'hr.support@xx.net';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 02:29 AM
Hi Pradeep,
var group=new GlideRecord('u_team_vanity_emails');
group.addQuery('u_squad',squad);
group.query();
if(group.next() && group.squad != ' '){
current.u_support_email=xx;
current.u_urgent_email=xx;
}
U mean like this, If i did like this in assignment group i need to select different different groups right?
so that time also this should work.?
Regards,
Ganesh.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 02:44 AM
What is squad here and is u_squad a reference field?
Also group.squad should be group.u_squad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 02:50 AM
Hi Pradeep,
sorry for confusion, The fields under the table is Squad, Support Email, Urgent Email.