I have to get User's location state value.

niveditakumari
Mega Sage

Hi, 

 

I have to get User's location state value. 

I have User's table and from User's table I have to get User's location and then state value in script. 

Below is attached screenshot : 

niveditakumari_0-1696543121111.png

 

In above screenshot I'm getting current logged in User and then I'm querying that in hr profile table and then I'm retrieving entCode and empClass from HR profile table and if that condition satisfy then after that I'm setting groupingName. 

In same way I need to query User's location and get state field value and if state is AB then I need to set groupingName. 

 

Can anyone please help me to achieve that. 

 

Regards, 

Nivedita

 

 

 

23 REPLIES 23

@niveditakumari 

field and widget are in different scopes

what comes in log? is it coming as undefined?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar

 

I'm not able to find anything in script log statement with state name. 

 

Regards, 

Nivedita

 

 

 

Hi @Ankur Bawiskar

 

What should I correct in my code how to debug and ho to fix that. 

 

Regards, 

Nivedita

 

 

@niveditakumari 

try to add log statements at proper place to verify code runs till which line

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader