Sanitizing with Microsoft Flow
Probably this is the first article where I decided to focus my attention on Microsoft Flow. I see this powerful service like your personal developer because you can achieve an amazing result without any line of code. Naturally, it doesn’t cover all business scenarios, but I love to use it when is possible. I love especially how can simplify things from a developer perspective. Lately, I’ve been working on a project where one requirement, was to clean a parameter defined by the user as input from some special characters.
So with some simple Flow steps, you can easily achieve this goal.
Solution
Now assuming that I have to remove some special characters from a string, let’s start to build our Flow. I’m gonna to create a Flow that will be triggered by a button just for this purpose and it will accept an input from the user “Title”:
Considering that in Flow the self-reference is not supported, then a variable cannot assign a value to herself, I need to use an extra variable. Below how looks like the initialization block:
In the function createArray(…), I’ll insert the characters that I want to remove:
In the next step I’ll iterate the array by replacing every character that I find:
Below the replace function:
Finally this is the result;