<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Arcade vs Portal and GetUser in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1323984#M1091</link>
    <description>&lt;P&gt;Okay, that explains why my suggestion was working for me in ArcGIS Online and not for you in Pro, it doesn't work for me in Pro either!&lt;/P&gt;&lt;P&gt;What version of Pro and &lt;A href="https://gisportal.localcompany.com/portal" target="_blank"&gt;https://gisportal.localcompany.com/portal&lt;/A&gt;&amp;nbsp;are you running?&lt;/P&gt;&lt;P&gt;If it's 10.9.1, there appears to be bug associated with GetUser and Attribute rules:&amp;nbsp;&lt;A href="https://community.esri.com/t5/attribute-rules-questions/getuser-10-9-1/m-p/1172250" target="_blank"&gt;https://community.esri.com/t5/attribute-rules-questions/getuser-10-9-1/m-p/1172250&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It's fixed in a patch &lt;A href="https://support.esri.com/en-us/patches-updates/2022/arcgis-server-10-9-1-utility-network-and-data-managemen-8045" target="_blank"&gt;https://support.esri.com/en-us/patches-updates/2022/arcgis-server-10-9-1-utility-network-and-data-managemen-8045&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Aug 2023 16:38:43 GMT</pubDate>
    <dc:creator>CarmelConnolly</dc:creator>
    <dc:date>2023-08-30T16:38:43Z</dc:date>
    <item>
      <title>Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1321277#M1056</link>
      <description>&lt;P&gt;I'm trying to obtain the user from one of the two portals we use.&amp;nbsp; Sometimes people are logged into both, sometimes only logged into one and sometimes not logged into either of them&lt;/P&gt;&lt;P data-unlink="true"&gt;Unfortunately if a person is not logged into both portals I get an error message: Failed to query url https://www.WhichEverPortalIsNotLoggedIn&amp;nbsp;.com/&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;Then the script bails out&lt;/P&gt;&lt;P data-unlink="true"&gt;I cannot figure out how to check to see if getUser can actually obtain something in order to continue the script&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;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);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions on how to get past this error&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 17:41:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1321277#M1056</guid>
      <dc:creator>Markbe_utco</dc:creator>
      <dc:date>2023-08-22T17:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1322114#M1066</link>
      <description>&lt;P&gt;What does the next part of your script do with&amp;nbsp;local_user?&lt;/P&gt;&lt;P&gt;Does the script bail out when&amp;nbsp;'local_user' specifically or afterwards?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 14:08:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1322114#M1066</guid>
      <dc:creator>CarmelConnolly</dc:creator>
      <dc:date>2023-08-24T14:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1322241#M1073</link>
      <description>&lt;P&gt;The next part is to simply return the a username into an attribute field, but the script bails when it hits the getUser line.&amp;nbsp; I'm not sure how to check if the getUser can actually access the portal before it attempt to do so.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 17:45:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1322241#M1073</guid>
      <dc:creator>Markbe_utco</dc:creator>
      <dc:date>2023-08-24T17:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1322425#M1075</link>
      <description>&lt;P&gt;Potentially something like this might work:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (IsEmpty(local_user) == false &amp;amp;&amp;amp; IsEmpty(agol_user) == false) {
	// Result returned for local_user and agol_user items
	// Continue with script to return usernames
	
} else {
	// Result returned for agol_user only
	// Continue script to return agol_user username only

}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 25 Aug 2023 08:14:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1322425#M1075</guid>
      <dc:creator>CarmelConnolly</dc:creator>
      <dc:date>2023-08-25T08:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1322678#M1076</link>
      <description>&lt;P&gt;Thanks for the suggestion, I did try it but as I thought it still bails out before the when getUser is first used in the variable definition&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;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);  &lt;/LI-CODE&gt;&lt;P&gt;The script bail out immediately when it hit either line 4 or line 5, when the user is not logged into either portal respectively.&lt;/P&gt;&lt;P&gt;I get this error message before it even gets to the if-then statements&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Invalid expression
Error on line 4.
Failed to query url https://gisportal.localcompany.com/portal&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 20:03:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1322678#M1076</guid>
      <dc:creator>Markbe_utco</dc:creator>
      <dc:date>2023-08-25T20:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1322896#M1079</link>
      <description>&lt;P&gt;Can you provide the entire script you have where it's erroring on line 4?&lt;/P&gt;&lt;P&gt;I ask because it works for me whether I use a real or a fake 'local_portal' URL and if I'm logged in or logged out of it:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CarmelConnolly_0-1693212094441.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/79249i29EB94B714E493C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CarmelConnolly_0-1693212094441.png" alt="CarmelConnolly_0-1693212094441.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Perhaps there's something else at play here, is your&amp;nbsp;'local_portal' URL &lt;A href="https://gisportal.localcompany.com/portal" target="_blank"&gt;&amp;nbsp;https://gisportal.localcompany.com/portal&lt;/A&gt;&amp;nbsp;accessible publically?&lt;/P&gt;&lt;P&gt;What happens if you use &lt;A href="https://gisportal.localcompany.com/portal" target="_blank"&gt;https://gisportal.localcompany.com/portal&lt;/A&gt;&amp;nbsp;as the&amp;nbsp;'local_portal' URL in your script instead of (I assume) the real one?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 08:44:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1322896#M1079</guid>
      <dc:creator>CarmelConnolly</dc:creator>
      <dc:date>2023-08-28T08:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1323023#M1080</link>
      <description>&lt;P&gt;No the 'local_portal' is not accessible publically.&lt;/P&gt;&lt;P&gt;During my debugging/troubleshooting I've tried to narrow it down to the barest essential lines&lt;/P&gt;&lt;P&gt;Also, I'm sorry that I did not mention this before; I am not using the script in a web browser interfaced session.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script is running within the Calculate Field tool within ArcGIS Pro using a concurrent license. Ultimately this script will, if a solutions is found, be used in an attribute rule.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var temp_portal = Portal ('https://www.thisfakeurlisfortestingpurposes.com')
var local_portal = Portal('https://gisportal.localcompany.com/portal');
var agol_portal = Portal('https://www.arcgis.com');

var temp_user = getUser(temp_portal);
var local_user = getUser(local_portal);
var agol_user = getUser(agol_portal);

var dummyVar = "DummyVar"
return dummyVar&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above script gives the error on line 5, and rightfully so because it is a fake url.&lt;/P&gt;&lt;P&gt;When line 5 is commented out I get the same error message now stating that the error is on line 6 when I am not logged into the 'localcompany' portal.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I am logged into the 'localcompany' portal I get the same error message now stating that the error is on line 7 when I am not logged into the agol.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I am logged into both the 'localcompany' and agol portals I don't not get any errors and the DummyVar is returned to the attribute table.&lt;/P&gt;&lt;P&gt;So the script is bailing out before any comparisons of variables being empty even takes place.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 16:01:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1323023#M1080</guid>
      <dc:creator>Markbe_utco</dc:creator>
      <dc:date>2023-08-28T16:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1323984#M1091</link>
      <description>&lt;P&gt;Okay, that explains why my suggestion was working for me in ArcGIS Online and not for you in Pro, it doesn't work for me in Pro either!&lt;/P&gt;&lt;P&gt;What version of Pro and &lt;A href="https://gisportal.localcompany.com/portal" target="_blank"&gt;https://gisportal.localcompany.com/portal&lt;/A&gt;&amp;nbsp;are you running?&lt;/P&gt;&lt;P&gt;If it's 10.9.1, there appears to be bug associated with GetUser and Attribute rules:&amp;nbsp;&lt;A href="https://community.esri.com/t5/attribute-rules-questions/getuser-10-9-1/m-p/1172250" target="_blank"&gt;https://community.esri.com/t5/attribute-rules-questions/getuser-10-9-1/m-p/1172250&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It's fixed in a patch &lt;A href="https://support.esri.com/en-us/patches-updates/2022/arcgis-server-10-9-1-utility-network-and-data-managemen-8045" target="_blank"&gt;https://support.esri.com/en-us/patches-updates/2022/arcgis-server-10-9-1-utility-network-and-data-managemen-8045&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 16:38:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1323984#M1091</guid>
      <dc:creator>CarmelConnolly</dc:creator>
      <dc:date>2023-08-30T16:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1323993#M1092</link>
      <description>&lt;P&gt;I'm running Pro 3.1.3&lt;/P&gt;&lt;P&gt;I'm not sure how it's a enterprise/portal issue as I am also getting the same error on my home version of Pro 3.1.3 which does not connect to any enterprise system.&lt;/P&gt;&lt;P&gt;I only get the error message when I'm not logged into a portal or if using a non-valid url.&amp;nbsp; When I am logged in I am able to retrieve the full name from the getUser dictionary as expected.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 16:58:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1323993#M1092</guid>
      <dc:creator>Markbe_utco</dc:creator>
      <dc:date>2023-08-30T16:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1324236#M1095</link>
      <description>&lt;P&gt;Yes but the Portal you're trying to connect to might be 10.9.1! I've reached my limit of being able to troubleshoot, I recommend next step is to raise directly with your local Distributor Tech Support team. Referencing this post will help them as well.&lt;/P&gt;&lt;P&gt;Carmel&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 07:51:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1324236#M1095</guid>
      <dc:creator>CarmelConnolly</dc:creator>
      <dc:date>2023-08-31T07:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1324579#M1096</link>
      <description>&lt;P&gt;Understandable and thank you for the time and help.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 21:27:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1324579#M1096</guid>
      <dc:creator>Markbe_utco</dc:creator>
      <dc:date>2023-08-31T21:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1505470#M1513</link>
      <description>&lt;P&gt;were you able to resolve this&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/567697"&gt;@Markbe_utco&lt;/a&gt;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 17:05:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1505470#M1513</guid>
      <dc:creator>ToddW_stl</dc:creator>
      <dc:date>2024-07-15T17:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1505474#M1514</link>
      <description>&lt;P&gt;No,&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 17:11:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1505474#M1514</guid>
      <dc:creator>Markbe_utco</dc:creator>
      <dc:date>2024-07-15T17:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade vs Portal and GetUser</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1505904#M1515</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/567697"&gt;@Markbe_utco&lt;/a&gt;&amp;nbsp;- BLUF: error handling/try-except not supported in Arcade (vote for idea linked below), no way to handle error encountered querying portal users (in Arcade) when not logged in, Python not supported for Attribute Rules, suggest trying editor tracking&lt;/P&gt;&lt;P&gt;---------------------------------------------&lt;/P&gt;&lt;P&gt;If I understand your desired workflow, you want to check "x" number of portals the user&amp;nbsp;&lt;EM&gt;may&lt;/EM&gt; or&amp;nbsp;&lt;EM&gt;may not&amp;nbsp;&lt;/EM&gt;be logged in to in order to capture at least one of their usernames in an attribute field via Attribute Rule in ArcGIS Pro.&lt;/P&gt;&lt;P&gt;I spent a little time testing and trying to come up with a solution, with no luck.&amp;nbsp; I think a few issues are at play here.&lt;/P&gt;&lt;P&gt;I don't think this is your issue, but noticed the Arcade docs use capital "G"&amp;nbsp;&lt;STRONG&gt;G&lt;/STRONG&gt;etUser instead of little "g"&amp;nbsp;&lt;STRONG&gt;g&lt;/STRONG&gt;etUser in your example(s).&lt;/P&gt;&lt;P&gt;I was able to capture both of my usernames when logged into both portals (ArcGIS Enterprise 11.3 and an ArcGIS Online Organization).&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var agol_portal = Portal('https://www.arcgis.com');
var local_portal = Portal('https://myportal.esri.com/portal');

var local_user = GetUser(local_portal);
var agol_user = GetUser(agol_portal);

var username = local_user.username + ' &amp;amp; ' + agol_user.username;
return username&lt;/LI-CODE&gt;&lt;P&gt;As you saw and as expected, an error is thrown attempting to GetUser from a portal a user is not logged in to.&amp;nbsp; I don't see a way around this except making sure your users log in to all necessary portals in Pro to do their work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Soo, I thought we could handle the error with a try-except!&amp;nbsp; Unfortunately, that's not supported in Arcade yet (give it a kudos/vote/whatever here, and I'll do the same:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-ideas/add-error-handling-try-catch-to-arcade-language/idi-p/1047180" target="_blank"&gt;https://community.esri.com/t5/arcgis-pro-ideas/add-error-handling-try-catch-to-arcade-language/idi-p/1047180&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;I thought we could use the try-except in Python, but unfortunately (again), Attribute Rules only use Arcade.&lt;/P&gt;&lt;P&gt;My final idea/suggestion (I'll leave leave for you to test and report back on), if possible, would be to enable editor tracking for the data in question:&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/introduction-to-editor-tracking.htm#ESRI_SECTION1_28E58EABE37D4EE180112EF1218B2A39" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/introduction-to-editor-tracking.htm#ESRI_SECTION1_28E58EABE37D4EE180112EF1218B2A39&lt;/A&gt;&amp;nbsp;.&amp;nbsp; Then, if you can't use one of the out of the box username fields, use an Attribute Rule to copy the desired value to your desired field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck sir!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 18:37:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/arcade-vs-portal-and-getuser/m-p/1505904#M1515</guid>
      <dc:creator>ToddW_stl</dc:creator>
      <dc:date>2024-07-16T18:37:07Z</dc:date>
    </item>
  </channel>
</rss>

