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 Automate
Unanswered

Removing extra text

(0) ShareShare
ReportReport
Posted on by 73

All,

 

I am inserting data into my SharePoint list from SQL table.

 

I have this field "Office". I would like to remove the extra text in these values. 

PowerAppsUser99_0-1677603520015.png

 

 

For example:
- I want only these values shown. Is it possible to filter it by the text "office?

"Elmwood Park office"

"Elmwood Park Office"

"New York Office"

 

PowerAppsUser99_1-1677603575857.png

 

Categories:
I have the same question (0)
  • trad Profile Picture
    152 on at

    Is the office string that you want always the last of a comma delimited list like you've shown? You might be able to do something like last(split(<office value>,',')) to get the string.

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Hi @PowerAppsUser99 ,

     

    Try to split the value with comma.

    --> last(split(Text,','))
     

    If I have answered your question, please mark my post as Solved.

    If you like my response, please give it a Thumbs Up.

     

    Regards

    Kaif

  • PowerAppsUser99 Profile Picture
    73 on at

    It is either in the front or in the back. It will never be in the middle 

    PowerAppsUser99_0-1677678680004.png


    would this still work? 

    last(split(<office value>,','))

  • PowerAppsUser99 Profile Picture
    73 on at

    It is either in the front or in the back. It will never be in the middle 

    PowerAppsUser99_0-1677678680004.png


    would this still work? 

    last(split(<office value>,','))

  • grantjenkins Profile Picture
    11,063 Moderator on at

    If your data is coming back as a string of words seperated by a comma then you could try the following.

     

    See full flow below. I'll go into the actions.

    grantjenkins_0-1677680603546.png

     

    Data is a Compose action that contains the data. This would be the property you already have.

    grantjenkins_1-1677680649641.png

     

    Filter array splits the data by comma, then checks to see if a lowercase version of each item contains 'office'. This will cater for uppercase, lowercase, mixed case, etc. The expressions used are below:

    //From - you would replace outputs('Data') with your property
    split(outputs('Data'), ',')
    
    //Filter
    toLower(item())

    grantjenkins_2-1677680793128.png

     

    Compose retrieves the first item from the Filter array and trims any leading/trailing spaces giving you what you're after. The expression used is:

    trim(first(body('Filter_array')))

    grantjenkins_3-1677680867233.png

     

    This should give you the result regardless of where it is in the string.


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

  • PowerAppsUser99 Profile Picture
    73 on at

    Thank you this did work. I had one more question. 

    So I have some records with blank/null offices. Can I skip these or remove the blank records?

     

    PowerAppsUser99_0-1677793887259.png

     

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard