Showing results for 
Search instead for 
Did you mean: 
Advocate I
Advocate I

Manipulating strings to remove common errors

**** Sorry should have posted to Flow board *****



I have an input that collects information entered by employees, however there are some common re-occurring errors that keep occurring that despite repeated instructions don’t seem to sink in. So in order to save time at a later date I though I would try and make the changes in flow. The main ones are:


1. Adding salutations to names for example Mr Smith being entered. I would prefer to just have the surname and loose the salutation, it makes sorting alphabetically a lot easier.

2. The second is with UK postcodes and not entering a space between the two sections I.e AA12BB or AA123BB.( not that they are of variant lengths but always have a space before the last three characters.


Also if there was a way to properly capitalise the strings that would help with my OCD lol, i.e Proper case for example 1 and all upper for the 2nd.


I have been able to add these strings as they currently are as variables before adding to a sharepoint list. I presume I need to use a compose action with the relevant expressions but cannot seem to get it to work.


Any assistance would be greatly appreciated.



Kudo Kingpin
Kudo Kingpin

Re: Manipulating strings to remove common errors

I'd probably do a few Replaces to eliminate the Mr. and Mrs, though you'll need to account for the different variations (such as Mr. versus Mr no period)


You can cascade this like replace(replace(YOURFIELD,'Mr',''),'Mrs','') and so on
You can use length(MYFIELD) to get the length of the variable length strings
Then do a calculation to get length minus 3, then use substring()
First part would look like: substring(MYFIELD,0,LENGTH-3)
Second part would look like substring(MYFIELD,LENGTH-3,LENGTH)
Then you can add them together in a variable or compose with the space.
I'd probably start by removing all spaces in the fiend before doing that algorithm, to account for whether they did actually add the space.
toUpper() will convert everything to upper case
Not sure what would conver to Proper case off the top of my head, but you could do some more substrings, combined with a toUpper on the first character.
Advocate I
Advocate I

Re: Manipulating strings to remove common errors

@BrentlessThanks for your help so far, do you know how to remove all spaces from the string, I've tried " replace(string," ","") but just says invalid expression.

Helpful resources


Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!


Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (4,296)