How to query a table

ganesh7
Kilo Contributor

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.

14 REPLIES 14

what is the group name you want to compare against?


here squad, support email and urgent email are the fields,



if squad name is SNOW



support email should be snow.support@company.net


urgent email should be snow.urgent@company.net



I need to query the table based on squad through glide query.


Hi Ganesh,



Try this.


var group=new GlideRecord('u_team_vanity_emails');


group.addQuery('u_squad.name',squad);


group.query();


if(group.next() && group.u_squad != ' '){


  current.u_support_email=xx;


  current.u_urgent_email=xx;


}


Hi Pradeep,



this is fine



var group=new GlideRecord('u_team_vanity_emails');


group.addQuery('u_squad.name',squad);


group.query();


if(group.next() && group.u_squad != ' '){


  current.u_support_email=group.u_support_email;


  current.u_urgent_email=group.u_urgent_email;


}


You mean it is working fine now