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

Fixing common errors in string

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Fixing common errors in string

Hi @Jimbo1,

 

About #1, do you want to skip the salutation and just have the surname? Please try to use a function skip to remove items from the front of a collection and return all the other items.

 

 

About #2, do you want to add a space between the two sections likes “DN1 11A”?

 

If yes, I have made a simple test on my side, please take it for a reference.

 

In the Compose, use the code to skip the salutation:

skip(triggerBody()['text'],3)

 

In Compose2,  use the code to add a space:

concat(substring(triggerBody()['text_1'],1,3),' ',substring(triggerBody()['text_1'],3,3))

1.PNG

 

Please take it for a reference and try it on your side.

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Super User III
Super User III

Re: Fixing common errors in string

@Jimbo1:

 

How are your users entering the data (directly into SharePoint, PowerApps, Forms, etc.)?

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Highlighted
Advocate I
Advocate I

Re: Fixing common errors in string

They are entering information via a third party software iauditor which I then use a HTTP action to connect to their api and retrieve each form. Unfortunately there is no way to format on the third party software as it’s just free text fields. It is done this way as it enables the easy capture of media etc which can then be saved to sharepoint.

 

Highlighted
Community Support
Community Support

Re: Fixing common errors in string

Hi @Jimbo1,

 

About #1, do you want to skip the salutation and just have the surname? Please try to use a function skip to remove items from the front of a collection and return all the other items.

 

 

About #2, do you want to add a space between the two sections likes “DN1 11A”?

 

If yes, I have made a simple test on my side, please take it for a reference.

 

In the Compose, use the code to skip the salutation:

skip(triggerBody()['text'],3)

 

In Compose2,  use the code to add a space:

concat(substring(triggerBody()['text_1'],1,3),' ',substring(triggerBody()['text_1'],3,3))

1.PNG

 

Please take it for a reference and try it on your side.

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Administrator
Administrator

Re: Fixing common errors in string

Hey, @Jimbo1!

 

Thank you for posting on the Flow Community Forum! It appears as though @v-yamao-msft would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!

 

Thank you for being an active member of the Flow Community!

 

-Gabriel
Flow Community Manager

-Gabriel
Community Manager
Microsoft Power Automate | Power Virtual Agents
Are YOU a member of a Power Platform User Group?
Fill out This Form to claim your Community User Group Member Badge!
Highlighted
Advocate I
Advocate I

Re: Fixing common errors in string

Hi @v-yamao-msft,

 

Thanks for your help, you certainly pushed me in the right direction.

 

I tweeked your suggestion for the postcode to the following:

 

1. Created Compose to remove all spaces

replace(outputs('Compose'),' ','')

2. Constructed 2nd Compose with the following to restructure the postcode in the correct format:

 

toupper(concat(substring(outputs('Compose_1'),0,sub(length(outputs('Compose_1')),3)),' ',skip(outputs('Compose_1'),sub(length(outputs('Compose_1')),3))))

 

All now seems to work correctly.

 

Thanks for your help

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

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.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (4,245)