I have to get User's location state value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 03:06 PM
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 :
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 07:17 AM
Hi @Ankur Bawiskar,
This is not working.
Please find attached screenshot :
I have added above code but it is not working.
Please help me to achieve that.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 08:52 PM
did you check what came in the state variable for logged in user?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 11:59 AM
Hi @Ankur Bawiskar,
I have added log statement to get state value.
Please find attached screenshot :
It is not printing state value.
Please correct me to achieve that.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 08:31 PM
are you sure the state field name is correct?
the logged in user has state populated in location?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2023 05:05 AM
Hi @Ankur Bawiskar,
Yes field name is correct.
Please see attached screenshot :
It is showing state as N/A but in log it should show log statement state is N/A.
Please correct me to achieve that.
Regards,
Nivedita