
Announcements
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 2 | FJRADA!TRA*1234 |
| String 3 | tail12-trail4&13345 |
The output I want is as below, with each special character replaced by a semi-colon:
| String 1 | AAA;12345667;9876542 |
| String 2 | FJRADA;TRA;1234 |
| String 3 | tail12;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!
Bulk replace characters using xpath
From
["AAA-12345667,9876542", "FJRADA!TRA*1234", "tail12-trail4&13345"]
Map
xpath(
xml('<b />'),
concat('translate("', item() ,'", "-,!*&", ";;;;;")')
)