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 Platform Community / Forums / Power Automate / Looping through items ...
Power Automate
Unanswered

Looping through items in an array to modify a string

(0) ShareShare
ReportReport
Posted on by 10

I am struggling to create a flow to clean some data that I get from a Sharepoint list. There is a variable called Identifier that contains strings with a variety of symbols, which I would like to replace with a semi-colon. For example, let's say the data looks like this: 

 

String 1

AAA-12345667,9876542
String 2FJRADA!TRA*1234
String 3tail12-trail4&13345

 

The output I want is as below, with each special character replaced by a semi-colon: 

String 1AAA;12345667;9876542
String 2FJRADA;TRA;1234
String 3tail12;trail4;13345

 

I created an array that contains all the special characters and then I want to create a loop that cycles through all the elements in the loop and updates the strings every time it encounters one of the special characters. 

 

I tried with Apply to Each loops first, but what happens is that it changes the special character on the original string each time. At the end of the loop, it leaves me with several different versions of the original string because the next iteration could not use the result of the previous one. 

 

I then tried to build a Do Until loop based on the example mentioned in this post, but cannot quite figure out how this person was doing it. They mention using compose to alter the original string, but the expression in the post is confusing to me. The post is from a few years ago and doesn't include any screenshots, so I am lost about what to do. Any help is appreciated, thank you!

Categories:
I have the same question (0)
  • Chriddle Profile Picture
    8,644 Super User 2026 Season 1 on at

    Bulk replace characters using xpath

    Chriddle_0-1709308975996.png

    From

    ["AAA-12345667,9876542", "FJRADA!TRA*1234", "tail12-trail4&13345"]

    Map

    xpath(
    	xml('<b />'),
    	concat('translate("', item() ,'", "-,!*&", ";;;;;")')
    )

     

    Chriddle_1-1709309049524.png

     

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 293

#2
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 223 Most Valuable Professional

Last 30 days Overall leaderboard