ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Core.Portal Namespace / PortalUserContent Class / PortalFolders Property
Example

In This Topic
    PortalFolders Property
    In This Topic
    Gets the collection of folders.
    Syntax
    public IReadOnlyList<PortalFolder> PortalFolders {get;}
    Public ReadOnly Property PortalFolders As IReadOnlyList(Of PortalFolder)
    Example
    Portal: Get the user content for the active user from the active portal
    var portal = ArcGISPortalManager.Current.GetActivePortal();
    var owner = portal.GetSignOnUsername();
    var userContent = await portal.GetUserContentAsync(owner);
    //Get content for a specific folder (identified by its folder id)
    //var userContent = await portal.GetUserContentAsync(owner, folderId);
    
    //Get all the folders
    foreach (var pf in userContent.PortalFolders)
    {
      //Do something with the folders
    
    }
    
    //Get all the content items
    foreach (var pi in userContent.PortalItems)
    {
      //Do something with the portal items
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also