Remove unwanted characters from String in Power Automate or Logic Apps Tutorial

2,928
0
Published 2024-03-23
What if I told you that you can remove unwanted characters from a string using 1 action? Whether it be unwanted symbols, letters or numbers or a combination of all, I will show you a very easy repeatable and efficient method of removing these characters from a string. This is really useful for extracting a number from a string, by keeping only the numbers or for removing symbols to ensure that a filename or folder path is compatible with SharePoint.

You will learn how to use Select action, Chunk, Contains, If and Join expressions and can use this to make your automation super efficient in both Power Automate or Logic Apps.

00:00 Intro
00:25 Build a flow to identify character matches
01:40 Create an array with Chunk
02:27 Using contains to identify if a character exists
04:23 Remove unwanted characters
05:14 Return the new string with Join
06:28 Keep numbers only
08:20 Summary of flow build

Got an idea? Or video request? Drop me a note here forms.office.com/r/4EqE7VHVfH 👍

Want to buy me a coffee www.buymeacoffee.com/DamoBird365

All Comments (14)
  • @paulblum4369
    I have been unable to get the string that we started with back into an array! MS Forms automatically put in string forms with odd characters like '/' separating commas. Tried to get rid of the /, but it just showed back up in the final product and seems to have stayed a string when I would like for it to become an array of separate strings.
  • @kylerayner1103
    Great video. I have this same thing in a flow. What if you wanted to replace specific text instead of a blank. For instance, double quote symbol " gets replaced with the text double quotes. Is there a way to map the symbols to what you want to replace with?
  • @Andyr010
    Another great example, perfectly explained. After stumbling upon your channel I have learned so much! I have another related use case with accented characters or needing to select based upon ASCII range of permitted characters. Would it be as simple as entering all the accented characters? What if I wanted to do more of a replace so the output still made sense, just that accented letters are replaced by a non-accented equivalent letter?
  • @jerometurmel4208
    Congratulations on your excellent work. I've observed your frequent use of the new editor and was wondering if you've encountered any challenges with it. In my experience, I've noticed expressions randomly disappearing within the Outlook connector, which raises concerns about its reliability for professional use. What are your insights on this matter?
  • @zahsam09
    Hey Damien, Thanks for the amazing video (as usual 😊) I have a use case where I need to extract the ID from an email subject which is always going to be in the following format: ITxxxxx where x is an integer. any thoughts?
  • @jlchen3135
    Thanks for many good video's. I tried to use chatgpt analysis the content/body of an email when it arrives. I am struggling with the issue that the body of the email contains not only the new message replied by the sender, but also old email conversation. could you please advice or make a video on how one can just capture the current email message body?
  • @inspectorlife85
    Good stuff!! Is there a way to use Power Automate to run Power Quary in the evening? Is that a simple automate? 😊
  • I could have done with that yesterday to get 1000 out of $1000 - Silver Level to then use the 1000 as an integer.