<?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: How do I get a username into a table Using Attribute Rules? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-get-a-username-into-a-table-using/m-p/1170735#M54761</link>
    <description>&lt;P&gt;So since most of my layers have editor tracking enabled I modified that a little bit, and used this.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;return {
    "edit": [
    {
        "className": "Logs",
        "adds":        [{
                    "attributes": {"editType": $editContext.editType,
                    "fclassName": "VA_SouthParcels",
                    "Date": Date(),
                    "User":$feature.last_edited_user,
                    "fclass_GlobalID": $feature.GlobalID,
                    "fclassObjectID": $feature.objectid    }    }]
    }
    
]

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which is nice because it even allows me to see if a user has deleted an item.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
    <pubDate>Wed, 04 May 2022 17:54:16 GMT</pubDate>
    <dc:creator>phess_luckstone</dc:creator>
    <dc:date>2022-05-04T17:54:16Z</dc:date>
    <item>
      <title>How do I get a username into a table Using Attribute Rules?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-get-a-username-into-a-table-using/m-p/1170271#M54718</link>
      <description>&lt;P&gt;I created a log table in a file geodatabase. (Just my playground for right now).&amp;nbsp; In this log table I want to keep track of the type of edit done to my feature classes, the name of the feature class, date, username, objectid and globalid in the feature.&amp;nbsp; I have gotten all but one piece of the puzzle, the username.&amp;nbsp; Here is my code below:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;return {
    "edit": [
    {
        "className": "Logs",
        "adds":        [{
                    "attributes": {"editType": $editContext.editType,
		#For Each Attribute Rule Put in Feature Class Name Below
                    "fclassName": "VA_SouthParcels",
                    "Date": Date(),
                    "fclass_GlobalID": $feature.GlobalID,
                    "fclassObjectID": $feature.objectid    }    }]
    }
    
]

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I have looked the documentation for the ArcGIS Arcade functions of GetUser, however I can't quite get it to work, any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 18:10:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-get-a-username-into-a-table-using/m-p/1170271#M54718</guid>
      <dc:creator>phess_luckstone</dc:creator>
      <dc:date>2022-05-03T18:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a username into a table Using Attribute Rules?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-get-a-username-into-a-table-using/m-p/1170513#M54732</link>
      <description>&lt;P&gt;I haven't worked with GetUser() yet, but you should be able to do something like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var user = GetUser($featureSet)
if(!IsEmpty(user)) {
    user = user.username
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your FGDB, you won't have success with this, because&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;When no user is associated with the workspace, such as a file geodatabase, an empty string will be returned.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;You could try turning on &lt;A href="https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/enable-editor-tracking.htm" target="_blank" rel="noopener"&gt;Editor Tracking&lt;/A&gt;, and then use the last_edited_user field:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var user = $feature.last_edited_user&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 06:47:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-get-a-username-into-a-table-using/m-p/1170513#M54732</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-05-04T06:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a username into a table Using Attribute Rules?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-get-a-username-into-a-table-using/m-p/1170735#M54761</link>
      <description>&lt;P&gt;So since most of my layers have editor tracking enabled I modified that a little bit, and used this.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;return {
    "edit": [
    {
        "className": "Logs",
        "adds":        [{
                    "attributes": {"editType": $editContext.editType,
                    "fclassName": "VA_SouthParcels",
                    "Date": Date(),
                    "User":$feature.last_edited_user,
                    "fclass_GlobalID": $feature.GlobalID,
                    "fclassObjectID": $feature.objectid    }    }]
    }
    
]

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which is nice because it even allows me to see if a user has deleted an item.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 17:54:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-do-i-get-a-username-into-a-table-using/m-p/1170735#M54761</guid>
      <dc:creator>phess_luckstone</dc:creator>
      <dc:date>2022-05-04T17:54:16Z</dc:date>
    </item>
  </channel>
</rss>

