Cheat Sheets/Power Automate/substring
Power Automate (WDL) function

substringPower Automate (WDL) function reference

Slice by position and length.

Syntax

wdl
substring(text, startIndex, [length])

Examples

wdl
substring('PowerStack', 5, 5)
"Stack"
wdl
substring(triggerBody()?['InvoiceNumber'], 0, 3)
The first three characters, e.g. "INV"

Omitting length returns the rest of the string from startIndex onward.

wdl
substring(item()?['Email'], indexOf(item()?['Email'], '@'))
Everything from the @ sign to the end of the address

Common mistakes & gotchas

Related Workflow Definition Language functions

From Strings

Used in these tutorials

← Back to the Power Automate (WDL) cheat sheet