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

  • Is this compatible with 21.4v of Appian Cloud?

    Threw this error yesterday:
    =isobjectexists("Document",pv!documentZIP) (Expression evaluation error at function 'isobjectexists': The passed parameter(s) are of the wrong type. Received the type com.appiancorp.common.xml.JaxbConversionException: JAXB was not able to produce a value for typed value TypedValue[it=3,v=[Document:533750]] as java class java.lang.Long.)

    And when I checked the following manually in an unnamed ER: 
    isobjectexists("Document",533750) 
    Then this returns true.

    Any suggestions, please?

    Thank you.

  • I was able to correct the issue by first checking for null or empty values in the variable and then by casting using tointeger. For some reason, returning a Document type as a value from a query will return the Document number, but will cause isobjectexists to fail, because a Document is not Long (Number (Integer)), however, tointeger() will correctly cast to the Document number.

Comment
  • I was able to correct the issue by first checking for null or empty values in the variable and then by casting using tointeger. For some reason, returning a Document type as a value from a query will return the Document number, but will cause isobjectexists to fail, because a Document is not Long (Number (Integer)), however, tointeger() will correctly cast to the Document number.

Children
No Data