<?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: get list of group members but profile name not username in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-list-of-group-members-but-profile-name-not/m-p/807788#M2346</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like the get_members() function returns a dictionary that contains three lists: users, admins, and owners. The contents of these lists are strings, so it doesn't look like we can derive the full name of each user as-is. However, using list comprehensions, you can create a list of &amp;lt;User&amp;gt; objects whose username appears in the resulting dictionary from get_members(). From this new list, you can print each user's name using the fullName property. See the code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;CODE&gt; # Authentication
portalURL = ""
username = ""
password = ""
org_gis = GIS(portalURL, username, password)&lt;/CODE&gt;&lt;/CODE&gt;


# Get a list of groups that have "SA" in the title.
sa_groups = org_gis.groups.search('title:SA')

# Get a list of all users in the portal (max 1000 users).
all_users = org_gis.users.search(max_users=1000)

# Select the third group in the list
g = sa_groups[2]

# Get a dictionary of all users, admins, owners of the group. 
response = g.get_members()

# Create a list of user objects whose usernames appear in the "users" list of the "response" dictionary.
lst = [u for u in all_users if u.username in response["users"]]
&lt;CODE&gt;# Print the full name of each user in the list.
for user in lst:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(user.fullName)&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:56:30 GMT</pubDate>
    <dc:creator>GeoJosh</dc:creator>
    <dc:date>2021-12-12T16:56:30Z</dc:date>
    <item>
      <title>get list of group members but profile name not username</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-list-of-group-members-but-profile-name-not/m-p/807787#M2345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This python in an AGOL Jupyter notebook returns me a list of usernames in the group as demo'd here:&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html?highlight=get_members" title="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html?highlight=get_members"&gt;arcgis.gis module — arcgis 1.8.0 documentation&lt;/A&gt;&amp;nbsp;. &lt;BR /&gt;Is there a smart way to return the users &lt;STRONG&gt;profile&amp;nbsp;name&lt;/STRONG&gt;, rather than their username.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;sa_groups = org_gis.groups.search('title:SA')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;g = sa_groups[2]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;response = g.get_members()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;for user in response['users'] :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt; print(user)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 00:24:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-list-of-group-members-but-profile-name-not/m-p/807787#M2345</guid>
      <dc:creator>PeterMacKenzie2</dc:creator>
      <dc:date>2020-06-12T00:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: get list of group members but profile name not username</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-list-of-group-members-but-profile-name-not/m-p/807788#M2346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like the get_members() function returns a dictionary that contains three lists: users, admins, and owners. The contents of these lists are strings, so it doesn't look like we can derive the full name of each user as-is. However, using list comprehensions, you can create a list of &amp;lt;User&amp;gt; objects whose username appears in the resulting dictionary from get_members(). From this new list, you can print each user's name using the fullName property. See the code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;CODE&gt; # Authentication
portalURL = ""
username = ""
password = ""
org_gis = GIS(portalURL, username, password)&lt;/CODE&gt;&lt;/CODE&gt;


# Get a list of groups that have "SA" in the title.
sa_groups = org_gis.groups.search('title:SA')

# Get a list of all users in the portal (max 1000 users).
all_users = org_gis.users.search(max_users=1000)

# Select the third group in the list
g = sa_groups[2]

# Get a dictionary of all users, admins, owners of the group. 
response = g.get_members()

# Create a list of user objects whose usernames appear in the "users" list of the "response" dictionary.
lst = [u for u in all_users if u.username in response["users"]]
&lt;CODE&gt;# Print the full name of each user in the list.
for user in lst:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(user.fullName)&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:56:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-list-of-group-members-but-profile-name-not/m-p/807788#M2346</guid>
      <dc:creator>GeoJosh</dc:creator>
      <dc:date>2021-12-12T16:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: get list of group members but profile name not username</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-list-of-group-members-but-profile-name-not/m-p/807789#M2347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;of course! thanks &lt;A href="https://community.esri.com/migrated-users/315254"&gt;Joshua Herman&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2020 01:07:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-list-of-group-members-but-profile-name-not/m-p/807789#M2347</guid>
      <dc:creator>PeterMacKenzie2</dc:creator>
      <dc:date>2020-06-23T01:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: get list of group members but profile name not username</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-list-of-group-members-but-profile-name-not/m-p/807790#M2348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;additionally (and probably obvious to python pro's) , to return these in an email recipient list, you can modify from&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="background-color: #edf8ca; font-size: 14px;"&gt;print(user.fullName)&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="background-color: #edf8ca; font-size: 14px;"&gt;to&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="background-color: #edf8ca; font-size: 14px;"&gt;to&amp;nbsp;print(str(user.email) + ",")&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2020 01:20:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-list-of-group-members-but-profile-name-not/m-p/807790#M2348</guid>
      <dc:creator>PeterMacKenzie2</dc:creator>
      <dc:date>2020-06-23T01:20:07Z</dc:date>
    </item>
  </channel>
</rss>

