ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Core.Portal Namespace / PortalFolder Class
Members Example

In This Topic
    PortalFolder Class
    In This Topic
    Represents a sub folder in the home folder of an user. The folders are used to organize content in a portal.
    Object Model
    PortalFolder ClassOnlineItem ClassTimeInstant Class
    Syntax
    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
    }
    
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
          ArcGIS.Desktop.Core.Item
             ArcGIS.Desktop.Core.Portal.OnlineItem
                ArcGIS.Desktop.Core.Portal.PortalFolder

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also