cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Manipulating strings to remove common errors

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

Hi,

 

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.

 

 

2 REPLIES 2
Highlighted
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)

 

replace(YOURFIELD,'Mr','')
 
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.
 
 
 
Highlighted
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

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Users online (3,051)