Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Fixing common errors in string

(0) ShareShare
ReportReport
Posted on by 53

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.

 

  • Jimbo1 Profile Picture
    53 on at
    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

  • GabrielStJohn Profile Picture
    on at
    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

  • Verified answer
    v-yamao-msft Profile Picture
    on at
    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

  • Jimbo1 Profile Picture
    53 on at
    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.

     

  • ScottShearer Profile Picture
    25,228 Most Valuable Professional on at
    Re: Fixing common errors in string

    @Jimbo1:

     

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492