TABLE OF CONTENTS



Basic Examples

Get File Title

((#file.title))

Get Current User Name

((#user.name))

Conditional Example

Check if a Value Exists

((#form.questionsMap['approval'].answers[0].content != null))

List Example

Extract Property from a List

#list.explodeProperty(#folder.items, 'title')

Search Example

#expr.search("type:file AND status:active")

Form Usage Example

Show Question Based on Another Answer

#form.questionsMap['q1'].answers[0].content == 'Yes'

Practical Example

Auto-populate a Field from Another Object

((#file.owner.name))

Key Tips

  • Always wrap expressions with (( )) where required
  • Use # to reference objects
  • Use dot notation for properties
  • Use helper functions for complex logic
  • Check context to know what data is available



Advanced Examples



1. Property Access & Chaining

Access Nested Properties

#file.owner.name

Retrieves a nested value by chaining object properties.


Safe Access Pattern (Check Before Use)

#file.owner != null ? #file.owner.name : ''

Prevents errors when a property might not exist. This allows an event to move forward and not exit if a step fails. 


2. Conditional Logic

Simple Condition

Return true if item.status = Active

#item.status == 'Active'

Conditional (Ternary)

If item.status = Active, then return "Open", otherwise "Closed"

#item.status == 'Active' ? 'Open' : 'Closed'

Multiple Conditions

#item.status == 'Active' && #item.priority == 'High'

Null Checks

#item.dueDate != null

3. Working with Forms

Get Answer Value

This examples references the question using it's alias 'q1'.

To assign an alias, go to the form question configuration -> see Advanced to assign the Alias 

#form.questionsMap['q1'].answers[0].content

Conditional Form Logic

#form.questionsMap['q1'].answers[0].content == 'Yes'

Used for:

  • Showing/hiding questions
  • Validation rules

Check if Answer Exists

#form.questionsMap['q1'].answers.size() > 0

4. List Operations (#list)

Extract Property from List

#list.explodeProperty(#folder.items, 'title')

Returns a list of file titles under a folder.


Extract Nested Property

#list.explodeProperty(#folder.items, 'owner.name')

Filter-Like Pattern (via condition)

#folder.items.?[#this.status == 'Active']

Returns only matching items.


Get First Item

#folder.items[0]

5. Search & Data Retrieval (#expr)

#expr.search("type:file")

#expr.search("type:file AND status:active")

Find by Path

#expr.findByPath('/Projects/Example/File.txt')

Entity Search (Users / Groups)

#expr.entitySearch("type:user AND name:John")

6. Working with Dates & Time

Convert String to Time

#expr.stringToTime('2024-01-01')

Compare Dates

#item.dueDate > #expr.stringToTime('2024-01-01')

7. Combining Data

Build Dynamic Values

#file.title + ' - ' + #user.name

#expr.search("type:file AND status:active")[0].title

8. Map Operations (#map)

Access Value by Key

Return a mapping of all file names under a folder. Assuming the item in context is a folder.

#map.get(#item.ancestors, 'title')

Check Key Exists

#map.containsKey(#item, 'activeTasks')

9. Dynamic Lookups

#expr.search("owner:" + #user.id)

Cross-Object Lookup

#expr.search("type:task AND relatedItem:" + #item.id)

10. Common Patterns

Default Value Fallback

#item.description != null ? #item.description : 'N/A'

Boolean from Text

#form.questionsMap['q2'].answers[0].content == 'Yes'

Count Results

#expr.search("type:file").size()

Key Takeaways

  • Use dot notation for object navigation
  • Use ternary conditions for safe fallbacks
  • Use #list for collections
  • Use #expr for search and dynamic data
  • Always consider null safety in advanced expressions