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

Notifications

Announcements

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,441 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard