Hoppa till huvudinnehållet

Get list of users in a group from Portal to populate drop down lists?

Kommentarer

6 kommentarer

  • Ryan Cooney

    Hi Alex,

    Inspired by your question, we've just added the following activities to the ArcGIS Maps SDK for JavaScript activity pack (v1.9.0):

    • Get Portal
    • Query Portal Groups
    • Query Portal Items
    • Query Portal Users

    You'll likely want to read up on portal's query syntax here https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm. Something like this is likely what you are after for the Query input:

    title:"field staff group"

    Once you've got the group there is a bit of an advanced move that uses the Evaluate Expression Async activity to get the members of the group. Maybe we can wrap that up in an activity too.

    I've built a little sample. Go to File > Open By URL and paste in https://www.arcgis.com/home/item.html?id=79fefebbae634e38a961fbd3850da557.

    It is certainly possible to do all these types of portal queries with the out-of-the-box Send Web Request activity, but it isn't nearly as friendly as these purpose built activities will be. 

    2
  • Alex St. John

    Hell yeah, thanks Ryan! I got it in my workflow and it works great.

    0
  • Ryan Cooney

    We also released a v1.10.0 this morning that adds a Get Portal Group Members activity so that you don't need to use the Evaluate Expression Async activity.

    1
  • Alex St. John

    @... Hey Ryan, going a bit deeper on here, I am having trouble retrieving the email address of the user following the query. The username retrieval has been awesome!

    The query is successful but several returned values are left null, including email, even though my email address is verified in ArcGIS Online.

    Checking in Fiddler as well, and the null email is not present in the response.

     

    Is there a way we can explicitly add email to the request so that it returns or is this an Esri issue that I should take up with them?

    0
  • Ryan Cooney

    Alex St. John , it looks like this is the intended behaviour of the query for users. The documentation https://developers.arcgis.com/rest/users-groups-and-items/user-search.htm doesn't say anything specific about it, but I can imagine that emails would be omitted on purpose.

    You should be able to use Send Web Request (with the “arcgis” Channel Name) or Send ArcGIS Request to /sharing/rest/community/users/<user-name-or-id>?f=json to get the email of an individual user. However, I think you will still find there are limitations on the email address. For example, it may only be available if the user making the request is an org admin.

    0
  • Alex St. John

    Cool, thank you! This is working for me, but I am an admin:

     

    0

Du måste logga in om du vill lämna en kommentar.