Power Apps Substring Function: Extract Text Using Left, Mid, and Right

If you’ve ever needed to pull out just part of a text string in Power Apps – like grabbing the first name from a full name, or extracting a year from an invoice code – you’re in the right place.

Power Apps doesn’t have a single function called “Substring” the way some other languages do. Instead, it gives you three functions that together cover every text extraction scenario you’ll ever run into:

  • Left — grabs characters from the beginning of a string
  • Mid — grabs characters from the middle (or anywhere you specify)
  • Right — grabs characters from the end of a string

These three are your go-to tools. Once you understand how each one works, you can combine them to handle even the trickiest text manipulation tasks. Let me walk you through the Power Apps Substring Function.

Why You’d Need These Power Apps Functions

Here’s the honest truth — most real-world Power Apps apps deal with messy text data. You’ll run into things like:

  • Employee IDs stored as "EMP-2024-00123", and you only need the number at the end
  • A full name like "John Smith", but you only want to display the first name
  • A product code like "NY-APR-2024", and you need to pull out just the year
  • An email address, and you want to extract the domain

That’s exactly where Left, Mid, and Right come in.

Power Apps Substring Function

Let me show you how each Power Apps Function works.

Method 1: The Power Apps Left Function

The Left function extracts a specified number of characters starting from the beginning of a string.

Syntax:

Left(String, NumberOfCharacters)
  • String — the text you want to extract from
  • NumberOfCharacters — how many characters to grab from the left

Example 1 — Extract a country code in Power Apps

Say you have a product code like "US-PROD-001", and you need just the country code "US".

Left("US-PROD-001", 2)
// Result: "US"
power apps get substring value

Example 2 — Get the first name from a full name

If you have a Power Apps text input control called TextInput1 where someone typed "Sarah Connor", and you want just "Sarah":

Left(TextInput1.Text, 5)
// Result: "Sarah"

But what if you don’t know how long the first name is? I’ll show you how to handle that dynamically in a later section.

power apps left function

Example 3 — Trim a label to a fixed character limit

If you want to cap a description at 50 characters (useful for Power Apps gallery labels):

Left(ThisItem.Description, 50)

If the description is shorter than 50 characters, Power Apps just returns the full string — it won’t throw an error.

Method 2: The Power Apps Right Function

The Right function does the same thing as Left, but from the end of the string.

Syntax:

Right(String, NumberOfCharacters)

Example 1 — Extract the last 3 digits of a product code

Right("NY-2024-003", 3)
// Result: "003"
power apps right function

Example 2 — Get the file extension in Power Apps

If you have a filename like "report_final.xlsx" and want just "xlsx":

Right("report_final.xlsx", 4)
// Result: "xlsx"
powerapps string functions

Example 3 — Pull the last four digits of a phone number

Right(TextInput1.Text, 4)
// Result: last 4 digits of whatever was typed

Method 3: The Power Apps Mid Function

This is the most flexible of the three. The Mid function lets you extract characters from anywhere in a string — not just the beginning or end.

Syntax:

Mid(String, StartingPosition, NumberOfCharacters)
  • String — the text to extract from
  • StartingPosition — the position of the first character you want (counting starts at 1, not 0)
  • NumberOfCharacters — how many characters to return (optional — if you leave this out, Mid returns everything from the starting position to the end of the string)

Example 1 — Extract the year from an invoice code

Say you have "NY-2024-003" and want just "2024":

Mid("NY-2024-003", 4, 4)
// Result: "2024"

Here’s how I counted it: N=1, Y=2, -=3, 2=4 — So the year starts at position 4, and it’s 4 characters long.

powerapps mid function

Example 2 — Extract from a fixed-format employee ID

For an ID like "EMP-00456" where you always want the numeric part starting at position 5:

Mid("EMP-00456", 5, 5)
// Result: "00456"
left, right, mid function in power apps

Example 3 — Extract everything from a position to the end

If you want to strip a prefix like "MSG: " from a string:

Mid("MSG: Meeting at 3pm", 6)
// Result: "Meeting at 3pm"

No need to specify the length — just leave it out, and Mid grabs everything from position 6 to the end.

Method 4: Power Apps Combining Mid + Find for Dynamic Extraction

All the examples above use fixed positions. But in real apps, the position of the text you want often changes. That’s where the Power Apps Find function becomes your best friend.

Find returns the index of the first occurrence of a specific character or substring within a string. Once you have that position, you can feed it directly into Mid.

Syntax of Find:

Find(FindString, WithinString [, StartingPosition])

Example 1 — Extract The Domain From An Email Address in Power Apps

Say the email is "john.smith@contoso.com" and you want everything after the @.

Mid(
"john.smith@contoso.com",
Find("@", "john.smith@contoso.com") + 1
)
// Result: "contoso.com"

Find("@", ...) returns the position of @, which is 11. Add 1 to that, and you get 12 — that’s where the domain starts. Mid then grabs everything from position 12 onward.

power apps mid and find functions

Example 2 — Extract Text Between Two Delimiters in Power Apps

This is a common one. Say you have a string like "Order|Pending|High" and you want just "Pending" (the text between the first and second pipe character).

Mid(
"Order|Pending|High",
Find("|", "Order|Pending|High") + 1,
Find("|", "Order|Pending|High", Find("|", "Order|Pending|High") + 1) - Find("|", "Order|Pending|High") - 1
)
// Result: "Pending"
power apps mid and find function examples

I’ll be honest — this looks scary. Let me break it down:

  1. Find("|", ...) — finds the first pipe, at position 6
  2. +1 makes the start position 7 (where “Pending” begins)
  3. The second Find looks for the next pipe after position 7, which is at position 14
  4. Subtract the first pipe position (6) and subtract 1 more → that gives you the length of “Pending” (7 characters)

Once you understand the logic, it becomes second nature. And if you regularly deal with data like this, it’s worth saving this as a reusable formula snippet.

Example 3 — Dynamic Extraction From a Text Input in Power Apps

If your app has a TextInput1 control where users type something like "INV-APR-2024", and you want to pull out the month:

Mid(
TextInput1.Text,
Find("-", TextInput1.Text) + 1,
Find("-", TextInput1.Text, Find("-", TextInput1.Text) + 1) - Find("-", TextInput1.Text) - 1
)
// Result: "APR"
power apps mid function examples

This dynamically finds both dashes and extracts whatever is between them — regardless of how long the first segment is.

Method 5: Power Apps Left + Find Functions Together

A super common pattern is using Left and Find together to grab everything before a specific character.

Example — Get the First Name From a Full Name in Power Apps

If someone types their full name in a text input:

Left(TextInput1.Text, Find(" ", TextInput1.Text) - 1)

This finds the space character, then uses Left to grab everything before it. The -1 is there because you don’t want to include the space itself.

For "Michael Jordan", this returns "Michael".

power apps find function examples

Method 6: Working with Power Apps Tables (Bulk Extraction)

Here’s something a lot of tutorials skip — Left, Mid, and Right can work on entire columns of data, not just single strings.

Say you have a SharePoint list called EmployeeList with a column called EmployeeID, and every ID looks like "EMP-XXXXX". You want to extract just the numeric part.

You can use this in a gallery or a collection:

AddColumns(
EmployeeList,
"NumericID",
Right(EmployeeID, 5)
)

This creates a new virtual column called NumericID with the last 5 characters of each EmployeeID. No looping needed — Power Apps handles it automatically for every row.

Power Apps Practical Real-World Scenarios

Let me show you a few scenarios I’ve personally used these functions for in actual Power Apps projects.

Scenario 1 — Displaying Initials From a Full Name in Power Apps

Left(FirstName, 1) & Left(LastName, 1)
// For "James Wilson" stored in two fields: "JW"
left, right function in power apps

This is great for avatar labels or compact views.

Scenario 2 — Masking sensitive data in Power Apps

If you want to display a partially hidden account number like "****4521":

"****" & Right(AccountNumber, 4)
right function examples in power apps

Scenario 3 — Extracting a Username From an Email in Power Apps

Left(User().Email, Find("@", User().Email) - 1)
// For "sarah.jones@company.com" → "sarah.jones"
power apps string functions with examples

I use this one all the time to personalize welcome messages in apps.

Scenario 4 — Building a reference code from parts in Power Apps

Say you want to build a code like "2024-001" from separate Year and ID fields:

Mid(Text(Year(Today()), "0000"), 1, 4) & "-" & Right("000" & Text(RecordID), 3)

Things to Watch Out For

A few gotchas I’ve run into that are worth knowing upfront:

  • Counting starts at 1, not 0. If you’re used to JavaScript or Python, this will trip you up. The first character in a Power Apps string is at position 1.
  • Mid returns blank if the start position is invalid. If your StartingPosition is negative or greater than the string length, you’ll get a blank — not an error. Build in a check with Len() if needed.
  • Left and Right never throw errors for length. If you ask for 10 characters from a 5-character string, you just get the full 5-character string back. That’s actually handy.
  • These functions are case-sensitive only when you need them to be. The functions themselves don’t change case — use Upper()Lower(), or Proper() alongside them if you need consistent casing.
  • Spaces count as characters. "Hello World" — that space in the middle is position 6. Easy to forget when you’re counting manually.

Quick Reference For Power Apps Functions

FunctionWhat It DoesSyntax
LeftExtracts from the startLeft(text, n)
RightExtracts from the endRight(text, n)
MidExtracts from any positionMid(text, start, length)
FindReturns the position of a substringFind(searchFor, text)
LenReturns total character countLen(text)

Conclusion

I hope you found this article helpful. In this guide, I explained how to use Left, Mid, and Right functions in Power Apps. I also showed how to combine them with Find and Len. These examples help you extract text easily.

If you are working with text data, these functions will be very useful. Start with simple cases and then try more advanced combinations. This will help you handle different text formats easily. With practice, your formulas will become cleaner and more efficient.

Also, you may like:

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App