web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Fixing common errors i...
Power Automate
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.

 

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @Jimbo1:

     

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

  • Jimbo1 Profile Picture
    53 on at

    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.

     

  • Verified answer
    v-yamao-msft Profile Picture
    on at

    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

  • GabrielStJohn Profile Picture
    on at

    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

  • Jimbo1 Profile Picture
    53 on at

    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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard