Documentation > CMS Template API Library > Asset > GetFileList(SortOrder,Nullable[Int32],List[String],List[String],List[String],List[String],Boolean)


Gets a list of files in this folder. All parameters are Optional.

public List<Asset> GetFileList(SortOrder,Nullable[Int32],List[String],List[String],List[String],List[String],Boolean)


The list of files.


sortOrder Optional: The sort order. Defaults to null. CrownPeak.CMSAPI.SortOrder
limit Optional: The maximum number of assets to return. Defaults to null. Nullable<Int32>
fieldNames Optional: The names of fields that will be preloaded into the returned assets. Defaults to null. List<String>
excludes Optional: Labels of the assets to be excluded from the returned list. Defaults to null. List<String>
filterStatus Optional: The workflow statuses to filter on. Defaults to null. List<String>
excludeFilterStatus Optional: The workflow statuses to exclude. filterStatus will be ignored if this is set. Defaults to null. List<String>
excludeProjectTypes Optional: Set to false if you want project related types like libraries templates, etc to be returned. Defaults to true. System.Boolean

Code Example


// Load up to 10 files
List<Asset> files = folderAsset.GetFileList(limit: 10);

// Load up to 10 Draft files
List<Asset> files = folderAsset.GetFileList(limit: 10, filterStatus: Util.MakeList("Draft"));

// Load All files that are not in archived or retired states
List<Asset> files = folderAsset.GetFileList(excludeFilterStatus: Util.MakeList("Archived","Retired"));

Connect with Crownpeak