Power Automate (WDL) function
length — Power Automate (WDL) function reference
Count characters (or array items).
Syntax
wdl
length(collection)
Examples
wdl
length('PowerStack')→ 10
wdl
greater(length(split(item()?['Tags'], ',')), 1)
→ true when more than one tag is present
wdl
equals(length(triggerBody()?['Attachments']), 0)
→ true / false
Also used under "Arrays & collections": count items in an array.
wdl
length(variables('rows'))→ A number
Common mistakes & gotchas
- Works on strings, arrays, and objects, but not numbers or booleans — passing a number throws a template function error.
- For an object, length() counts top-level properties only, not nested ones.
Related Workflow Definition Language functions
From Strings
Used in these tutorials
Power Automate Select Action: Beyond Basic Column Picking – 5 Advanced TransformationsFrom Raw Strings to Structured Data: A Guide to Power Automate Text FunctionsStreamline Invoice Processing with AI Builder and Power AutomateBeyond the 5000 Limit: Fetching SharePoint List Items with Pagination in Power Automate