Script to check location value

Sajal Chatterje
Tera Contributor

Hello Comunity,

 

There is a need to check for location value mapped??

 

So what is happening, for certain user's location is showing empty(actually it is not hidden, display value is not mapped)but some dummy value is mapped in backend.Not displaying the value.

 

Can anyone help me.how we can check using script for these scenario?.I would need to implement this script in scheduled job.Please help here for implementation of condition.

 

Thanks,

Sajal

3 REPLIES 3

Maik Skoddow
Tera Patron
Tera Patron

Hi @Sajal Chatterje 

sorry, don't get your point. Please provide a screenshot to help us understand you better.

Maik

Sajal Chatterje
Tera Contributor

Hello Mike,

Is there a way if we can check if the location mapped in user profile is different or not present in our location table??

Could you please help me with filter condition on user profile list view?

 

Thanks,

Sajal

chetanb
Tera Guru

you can write script -1) Get user location from sys_user table for the user 

like userLocation=user.location;

2) Fire Query on Location table and compare user's location

var Loc=new GlideRecord('ur_location_table');//Use your location table name instead of ur_location_table'

Loc.addQuery('location_field', userLocation);////Use your location_field name from location table 

Loc.query();

var locRecord='';

if(Loc.next()){

locRecord=Loc.getValue('location_field');

}

return