The CreatorCon Call for Content is officially open! Get started here.

Service Portal - Cannot find function getLocation

Jesi Perinbaraj
Kilo Contributor

Hi All,

I want the current user's location in the service portal page. I used the below code

HTML:

{{data.location}}

and in the Server Script:

data.location = gs.getUser().getLocation();

Below is the error I get-

Server JavaScript error Cannot find function getLocation in object com.glide.script.fencing.ScopedUser@1166b0e.

Please let me know how can we use these functions in scoped applications?

Thanks in advance,

Jessie

1 ACCEPTED SOLUTION

Oh ok. Try data.location = user.location.getDisplayValue();


View solution in original post

6 REPLIES 6

You are Awesome Brad!!!



It worked. Thank you so much!


Where does the user object come from? As I've tried this code by adding it and can say this doesn't work (Istanbul).