Check Object Existence

Overview

This function helps in situations where the designer or developer has to act upon an Appian object (e.g. Document, Folder, Community, Knowledge Center).  Before doing any operations on the Appian object this function can be used to check whether the object exists.

Syntax: isObjectExists(typeOfObject, objectId)

Returns true or false based on the existence of the Appian object

Anonymous
Parents
  • Now that this plug-in has been archived, everyone should replace the functionality using the Content Tools plug-in, namely using the "Get Content Object Details By Id" function. 

    This function can check for the mere existence of an item at that ID, e.g.

    getcontentobjectdetailsbyid(ri!id) <> "No object with this ID has been found"

    but also, it can be used (in one pass) to check specifically for Document or Folder IDs, e.g.

    find(
      "Type: Document,",
      getcontentobjectdetailsbyid(ri!docId)
    ) > 0
    
    /* or... */
    
    find(
      "Type: Folder,",
      getcontentobjectdetailsbyid(ri!folderId)
    ) > 0

    As always, I recommend staging your own "helper expression rules" to handle null-checks and other housekeeping at the same time as calling the rule, to facilitate re-use and code-readability.  See my slightly older comment here for an example recipe.

Comment
  • Now that this plug-in has been archived, everyone should replace the functionality using the Content Tools plug-in, namely using the "Get Content Object Details By Id" function. 

    This function can check for the mere existence of an item at that ID, e.g.

    getcontentobjectdetailsbyid(ri!id) <> "No object with this ID has been found"

    but also, it can be used (in one pass) to check specifically for Document or Folder IDs, e.g.

    find(
      "Type: Document,",
      getcontentobjectdetailsbyid(ri!docId)
    ) > 0
    
    /* or... */
    
    find(
      "Type: Folder,",
      getcontentobjectdetailsbyid(ri!folderId)
    ) > 0

    As always, I recommend staging your own "helper expression rules" to handle null-checks and other housekeeping at the same time as calling the rule, to facilitate re-use and code-readability.  See my slightly older comment here for an example recipe.

Children
No Data