Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

How to split string by the first space in Power Automate

Posted on December 15, 2021December 19, 2021 by Tom

“I have a string where the actual data starts after an id number and a space, how can I split it by the first space and process only the data with Power Automate?”


When you split strings in Power Automate, you can use the expression split(…). You enter the string to split, the separator, and you’ll get back an array with all the pieces. It’s a solution described in one of the previous posts. But what if it’s not that simple? If you don’t want to split the whole string, but split just a part of it? Only at the first occurrence of the separator, and keep the rest untouched?

Split(…) the string anyway

You still want to start with the split(…) expression. Take the whole string and split it. The reason is that even though it’ll split it into multiple pieces, it’ll create an array. And it’s much easier to work with an array. Let’s take an example and split the string by a space.

split(<string to split>, <separator>)

As you can see, the result is an array with each part of the string as a separate item.

Skip(…) the part before the first space

Once you have an array, it’s easy to ignore a piece of it, much easier than to ignore a part of a string. Power Automate has an expression skip(…) exactly for that. The skip(…) expression expects an array and a number of items it should skip.

skip(<array>, <number of items to skip>)

To skip the first item in the array, use the number 1. Extending the expression from above:

skip(split(outputs('Compose'), ' '), 1)

Join(…) the array back into a string

Now, when you removed the undesired item, you can take all the remaining items and turn the array back into a string. With the join(…) expression take the array, define the delimiter, and turn it into a string. It’s the reverse process from the split(…) in the first step, therefore, you should use the same separator.

join(<array>, '<delimiter>')

Following the example in this post, it might look like:

join(skip(split(outputs('Compose'), ' '), 1), ' ')
Power Automate split string first space

The result is the original string without the part before the first space.

Power Automate split string first space

Summary

Power Automate expressions make it easy to split a string by the first space, if you convert it to an array first. It’s much easier to work with, so don’t be afraid to use it. You can navigate an array, skip or take part of it, and when you’re done, you can easily convert it back to a string. You don’t care about the string length, or how long is the part to skip, all the things you’d have to do if you kept it as a string…


πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Working on an Approval process?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy a fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes