- Print
- DarkLight
- PDF
Replacing Text in Power Automate Desktop
- Print
- DarkLight
- PDF
I was recently providing an RPA in a Day session where someone brought up how can I replace a ‘$’ with nothing. As part of our scenario, we wanted to represent an amount of $500 as just 500.
In the Power Automate Desktop GUI, there are validations that prevent us from leaving the Replace with value to be a space or just nothing.
Solution
To build this, we will start by declaring an input variable. We will call it Amount and will set the Default value to be $500.
Next, we will add the Replace text action and set our Text to parse equal to our %Amount% variable that we just defined. We will then set our Replace with to be %’’%. This action will have a Variable produced that is called Replaced. We will use this value in our next step.
Note: that is two single quotes ‘ in between the % signs
To validate that our solution works, we will add a Display message action to our design surface. We can populate Message box title with Result and our Message to display with our Replaced variable.
We can no go ahead and run our Desktop flow. When it runs, we will see that our original Amount of $500 is now 500.
Conclusion
While it may not be overly intuitive, you can replace text in Power Automate Desktop with ‘nothing’. This allows you to remove unneeded characters from text that you are processing.