Custom Content Functions

Contains a collection of Functions and Smart Services that provide search or retrieve of Appian content and act on Appian content types.

Functions:

  • findDocumentsByName
    • Searches from a root folder and returns a list of all documents matching the specified documentName (root folder can be a targeted folder or KC, or alternatively, can search the global collaboration hierarchy)
  • getDocumentsFromFolder
    • Returns a list of all documents which are children of the specified rootFolder (optionally recursive). Can search by name, size, type, created, modified; ascending or descending.  Two optional arguments “sort by” (name, updated, created, size, type, creator, version), and “isAscending” (defaults to true).
  • findContentByAttribute
    • Allows for searching for content (folders, documents) by attribute - valid values are "name", "author", "description" (Document only), "extension" (Document only)
  • getSubfoldersFromFolder
    • Returns a list of all folders which are children of the specified rootFolder (optionally recursive)
  • getFolderSearchability
    • Returns whether the specified folder is searchable or not
  • setFolderSearchability
    • Sets a specified folder's visibility flag to enable/disable searching. Additionally updates all child documents and provides an option to recursively set all child folders/documents.
  • getFilesLargerThanSize
    • Gets files in a specified Knowledge Center that are larger than the specified size (in bytes)
  • getFilesOlderThanDate
    • Gets files in a specified Knowledge Center that are older than the specified date
  • getConstantsFromFolder
    • Returns constants from a folder
  • returnContentRoleMap
    • Returns the security rolemap for a given content object
  • contentSecurityRoleMap (datatype)
    • CDT that backs the returnContentRoleMap function

Smart Services:

  • Delete Document Version
  • Delete Folder Contents
  • Delete Documents Created Before Date Smart Service

Notes:

  • All search functions assume the root folder and all subfolders are searchable.  Search functions will not return results contained within non-searchable objects
  • All functions use the serviceContext of the user account executing the expression at runtime
  • Passing a 0 or a 1 as the id can cause high heap usage. A “1” queries the most top-level container in Appian (i.e. Default Community) and if performing a recursive search, there could be high memory usage. Always verify you're passing the desired content container ID for the search.