<?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 getuser() issues with registered enterprise service in AGOL while disconnected in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/getuser-issues-with-registered-enterprise-service/m-p/1618948#M10893</link>
    <description>&lt;P&gt;I came upon a weird issue yesterday. In one of our projects, we registered an Enterprise feature service to AGOL, and we use an Arcade field calculation to populate an "Inspector" attribute using&amp;nbsp;&lt;SPAN&gt;GetUser&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$layer&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;username. As noted in previous threads, the .fullname property does not work offline, but the .username property does work offline.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However...we have found the following combination creates an unexpected result: &lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;If using&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;GetUser&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$layer&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;username with a registered Enterprise feature service in AGOL&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;...with an offline map&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;...and in Airplane Mode (or cellular turned off)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;...returns the &lt;STRONG&gt;Portal user name&lt;/STRONG&gt; of the user who &lt;U&gt;registered the Enterprise service&lt;/U&gt; to AGOL, instead of the currently logged-in AGOL user&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Everything works fine if there is any sort of connectivity. In other words, works fine with an offline map as long as you have a pulse on your cellular. Also works fine with hosted layers, of course. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I did find a workaround:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Create a new, empty hosted layer in AGOL&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Enable sync, add to the Field Map, turn off editing for the layer in Field Maps&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;In Field Maps config, direct the getuser() function toward this AGOL hosted layer rather than the current registered Enterprise layer.&amp;nbsp;&lt;/SPAN&gt;ex:&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;user&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;GetUser&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"Layer_Name"&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;username&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;username&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Then everything works fine, just need to add a "fake" hosted layer into the map to force Field Maps to do the right thing.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;Surely this is a bug? Returning the login info of the&amp;nbsp;&lt;EM&gt;app&lt;/EM&gt; seems like a pretty basic function, not sure why it's tied to the data layer and not the app itself. Am I missing something? Is there a more elegant way to do this that doesn't involve adding a fake layer?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 28 May 2025 17:13:31 GMT</pubDate>
    <dc:creator>PaulPetersen1</dc:creator>
    <dc:date>2025-05-28T17:13:31Z</dc:date>
    <item>
      <title>getuser() issues with registered enterprise service in AGOL while disconnected</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/getuser-issues-with-registered-enterprise-service/m-p/1618948#M10893</link>
      <description>&lt;P&gt;I came upon a weird issue yesterday. In one of our projects, we registered an Enterprise feature service to AGOL, and we use an Arcade field calculation to populate an "Inspector" attribute using&amp;nbsp;&lt;SPAN&gt;GetUser&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$layer&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;username. As noted in previous threads, the .fullname property does not work offline, but the .username property does work offline.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However...we have found the following combination creates an unexpected result: &lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;If using&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;GetUser&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$layer&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;username with a registered Enterprise feature service in AGOL&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;...with an offline map&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;...and in Airplane Mode (or cellular turned off)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;...returns the &lt;STRONG&gt;Portal user name&lt;/STRONG&gt; of the user who &lt;U&gt;registered the Enterprise service&lt;/U&gt; to AGOL, instead of the currently logged-in AGOL user&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Everything works fine if there is any sort of connectivity. In other words, works fine with an offline map as long as you have a pulse on your cellular. Also works fine with hosted layers, of course. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I did find a workaround:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Create a new, empty hosted layer in AGOL&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Enable sync, add to the Field Map, turn off editing for the layer in Field Maps&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;In Field Maps config, direct the getuser() function toward this AGOL hosted layer rather than the current registered Enterprise layer.&amp;nbsp;&lt;/SPAN&gt;ex:&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;user&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;GetUser&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"Layer_Name"&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;username&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;username&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Then everything works fine, just need to add a "fake" hosted layer into the map to force Field Maps to do the right thing.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;Surely this is a bug? Returning the login info of the&amp;nbsp;&lt;EM&gt;app&lt;/EM&gt; seems like a pretty basic function, not sure why it's tied to the data layer and not the app itself. Am I missing something? Is there a more elegant way to do this that doesn't involve adding a fake layer?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 17:13:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/getuser-issues-with-registered-enterprise-service/m-p/1618948#M10893</guid>
      <dc:creator>PaulPetersen1</dc:creator>
      <dc:date>2025-05-28T17:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: getuser() issues with registered enterprise service in AGOL while disconnected</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/getuser-issues-with-registered-enterprise-service/m-p/1618968#M10894</link>
      <description>&lt;P&gt;Known issue for a few years now.&amp;nbsp; I guess its still not fixed.&lt;/P&gt;&lt;P&gt;Some workarounds in these posts&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-field-maps-questions/quot-failed-to-calculate-quot-error-on-getuser/m-p/1356023#M7482" target="_blank"&gt;https://community.esri.com/t5/arcgis-field-maps-questions/quot-failed-to-calculate-quot-error-on-getuser/m-p/1356023#M7482&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-field-maps-questions/getuser-when-offline-and-disconnected/td-p/1265027" target="_blank"&gt;https://community.esri.com/t5/arcgis-field-maps-questions/getuser-when-offline-and-disconnected/td-p/1265027&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-field-maps-questions/quot-failed-to-calculate-quot-error-on-getuser/td-p/1274613" target="_blank"&gt;https://community.esri.com/t5/arcgis-field-maps-questions/quot-failed-to-calculate-quot-error-on-getuser/td-p/1274613&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-field-maps-questions/form-calculate-getuser-offline/td-p/1166748" target="_blank"&gt;https://community.esri.com/t5/arcgis-field-maps-questions/form-calculate-getuser-offline/td-p/1166748&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-field-maps-questions/field-maps-getuser-not-working-in-mobile-app/td-p/1356484" target="_blank"&gt;https://community.esri.com/t5/arcgis-field-maps-questions/field-maps-getuser-not-working-in-mobile-app/td-p/1356484&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 17:27:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/getuser-issues-with-registered-enterprise-service/m-p/1618968#M10894</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2025-05-28T17:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: getuser() issues with registered enterprise service in AGOL while disconnected</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/getuser-issues-with-registered-enterprise-service/m-p/1619009#M10895</link>
      <description>&lt;P&gt;Thanks Doug. I've seen those posts. The main thing that makes my case unique is registering an Enterprise service with AGOL. So far I haven't seen any workarounds besides the one I just came up with.&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 17:53:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/getuser-issues-with-registered-enterprise-service/m-p/1619009#M10895</guid>
      <dc:creator>PaulPetersen1</dc:creator>
      <dc:date>2025-05-28T17:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: getuser() issues with registered enterprise service in AGOL while disconnected</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/getuser-issues-with-registered-enterprise-service/m-p/1619118#M10897</link>
      <description>&lt;P&gt;In one case I overcame this by enabling editor tracking which will capture the logged in username.&lt;/P&gt;&lt;P&gt;Then, since it is registered Enterprise service, I have a trigger in the database that calculates the user info to the appropriate table/fields(s).&amp;nbsp; Couldn't just use editor tracking as I needed the username updated in a related tracking table.&lt;/P&gt;&lt;P&gt;Have not tested in a completely offline/disconnected environment.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 22:22:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/getuser-issues-with-registered-enterprise-service/m-p/1619118#M10897</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2025-05-28T22:22:53Z</dc:date>
    </item>
  </channel>
</rss>

