Arcade vs Portal and GetUser

866
10
08-22-2023 10:41 AM
Markbe_utco
New Contributor III

I'm trying to obtain the user from one of the two portals we use.  Sometimes people are logged into both, sometimes only logged into one and sometimes not logged into either of them

Unfortunately if a person is not logged into both portals I get an error message: Failed to query url https://www.WhichEverPortalIsNotLoggedIn .com/ 

Then the script bails out

I cannot figure out how to check to see if getUser can actually obtain something in order to continue the script

var local_portal = Portal('https://gisportal.localcompany.com/portal');
var agol_portal = Portal('https://www.arcgis.com');

var local_user = getUser(local_portal);
var agol_user = getUser(agol_portal);

 

Any suggestions on how to get past this error

Tags (2)
10 Replies
Markbe_utco
New Contributor III

Understandable and thank you for the time and help.