Power Automate (WDL) function
trim — Power Automate (WDL) function reference
Remove leading/trailing spaces.
Syntax
wdl
trim(text)
Examples
wdl
trim(' hi ')→ "hi"
wdl
equals(trim(item()?['Code']), 'PO-100')
→ true / false
wdl
not(empty(trim(triggerBody()?['Comment'])))
→ false for a whitespace-only comment
Common mistakes & gotchas
- trim() only removes leading/trailing whitespace — internal double spaces need replace(), not trim().
- A field containing only spaces is not empty() until it's trimmed first — a common bug when validating "required" text inputs.
Related Workflow Definition Language functions
From Strings