Model Object
propertyIsPresent()
Signature
Section titled “Signature”propertyIsPresent() — returns boolean
Available in: model
Category: Miscellaneous Functions
Description
Section titled “Description”Returns true if the specified property exists on the model and is not a blank string.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
property | string | yes | — | Name of property to inspect. |
Examples
Section titled “Examples”// 1. Check if a non-blank property is present
employee = model("Employee").new();
employee.firstName = "Jane";
writeOutput(employee.propertyIsPresent("firstName")); // true
// 2. Returns false when the property is an empty string
employee = model("Employee").new();
employee.firstName = "";
writeOutput(employee.propertyIsPresent("firstName")); // false
// 3. Returns false when the property does not exist on the object
employee = model("Employee").new();
writeOutput(employee.propertyIsPresent("nonExistentField")); // false