web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Split String

(0) ShareShare
ReportReport
Posted on by

I have a string of text that I need to split into "pairs." 

 

DODODODODODODODOUSUSDOUSUSDOUSUSDODOUSUSDOUSUSDODOUSUSDODODODO

 

So for the outcome I want: 

0: DO

1: DO

         and so forth.... 

 

I'm composing the variable, putting it in a string, and then using a select to break it apart. It is splitting it, but it's returning every other result in backwards order (DO = OD), and they are duplicates, meaning I'm not getting the full string broken down, just 50% of it because every entry repeats. 

 

Select From: 
range(0, add(div(length(variables('DailyActivities')), 2), 1))

Map: 
substring(variables('DailyActivities'), mul(item(), 1), 
if(greater(add(mul(item(), 2), 2), length(variables('DailyActivities'))), 
sub(length(variables('DailyActivities')), mul(item(), 2)), 2))

Response: 
[
 "DO",
 "OD",
 "DO",
 "OD",
 "DO",
 "OD",
 "DO",
 "OD",
 "DO",
 "OD",
 "DO",
 "OD",
 "DO",
 "OD",
 "DO",
 "OU",
 "US",
 "SU",
 "US",
 "SD",
 "DO",
 "OU",
 "US",
 "SU",
 "US",
 "SD",
 "DO",
 "OU",
 "US",
 "SU",
 "US",
 ""
]

 

Help please! 

 

StringSplit1.JPGStringSplit2.JPG

Categories:
I have the same question (0)
  • Rex2025 Profile Picture
    on at

    Thank you. This looks fantastic but I'll have to keep using the provided options at this time as I'm not in a position to spend any money. 

  • Verified answer
    Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at

    Hi @Rex2025 

     

    Use chunks function in power automate to split a array/string into equal length 

    see below

    Nived_Nambiar_0-1696607243870.png

     

    Here i am using chunk to split the string into length of each split as 2

     

    See below result of above expression :

    Nived_Nambiar_1-1696607327582.png

     

    Hope it helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • VictorIvanidze Profile Picture
    13,079 on at

    Use the chunk function: https://zeitgeistcode.com/power-automate-chunk-function/

  • Rex2025 Profile Picture
    on at

    Phenomenal! Thank you so much! Chunk worked GREAT!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard