ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Core.Portal Namespace / PortalItem Class
Members Example

In This Topic
    PortalItem Class
    In This Topic
    Represents an item (a unit of content) in the portal. An item may have associated binary or textual data which is available via the GetDataAsync() method.
    Object Model
    PortalItem ClassOnlineItem ClassTimeInstant Class
    Syntax
    Example
    Portal: Get the user content for the active user from the active portal
    {
      var activePortal = ArcGISPortalManager.Current.GetActivePortal();
      var owner = activePortal.GetSignOnUsername();
      var activeUserContent = await activePortal.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.PortalItem

    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also