Select to view content in your preferred language

Getting the portal and user name in Developer Edition

381
2
Jump to solution
11-12-2024 12:50 PM
KenBuja
MVP Esteemed Contributor

I've developing a widget and am working on the Settings panel. I'd like to automatically populate text boxes for the portal that the user is currently working in and their name instead of having them type in in themselves. What's the way to get this information?

0 Kudos
1 Solution

Accepted Solutions
JeffreyThompson2
MVP Frequent Contributor

You should be able to find this information on the props object available to all widgets.

props.portalUrl will get the Portal Url.

props.user is an object with all the data about the user. I have found this object sometimes comes in undefined in Developer Edition 1.14 and may still be an issue in 1.15.

GIS Developer
City of Arlington, Texas

View solution in original post

0 Kudos
2 Replies
JeffreyThompson2
MVP Frequent Contributor

You should be able to find this information on the props object available to all widgets.

props.portalUrl will get the Portal Url.

props.user is an object with all the data about the user. I have found this object sometimes comes in undefined in Developer Edition 1.14 and may still be an issue in 1.15.

GIS Developer
City of Arlington, Texas
0 Kudos
KenBuja
MVP Esteemed Contributor

Thanks! I hadn't thought to examine the props object more carefully.

0 Kudos