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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How i can get all the ...
Power Automate
Answered

How i can get all the charecters after the first "-"

(0) ShareShare
ReportReport
Posted on by 3,514

I have values such as:-

 

Station-Quebec

Station-St-Marys

Stat-Test

 

so how i can get all the characters after the first "'-" ? so i should get :-

 

Quebec

St-Marys

Test

 

? thanks

 

 

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,830 Most Valuable Professional on at

    Hi @johnjohn123,

     

    One approach could be to use an indexOf to determine the position of the first - character. After that you can use the length of the whole string to calculate the part you want to collect with a substring.

     

    Below is an example of that approach:

    substring(outputs('Compose'), add(indexOf(outputs('Compose'), '-'), 1), sub(length(outputs('Compose')), add(indexOf(outputs('Compose'), '-'),1)))

     

    indexof_substring.png

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @johnjohn123 :

    I've made a test for your reference:

    vbofengmsft_0-1633422011298.png

    vbofengmsft_1-1633422022037.png

    Reference expression:

    1\split(outputs('Compose'),variables('Return'))
    2\skip(items('Apply_to_each'),add(indexOf(items('Apply_to_each'),'-'),1))

    The Result

    vbofengmsft_2-1633422090795.png

     

    Best Regards,

    Bof

     

  • Verified answer
    Paulie78 Profile Picture
    8,422 Moderator on at

    Like this:

    2021-10-05_09-58-25.png

    The two expressions in the select action are:

    split(outputs('Compose'), decodeUriComponent('%0A'))
    
    join(skip(split(item(), '-'), 1), '-')

    Blog: tachytelic.net

    YouTube: https://www.youtube.com/c/PaulieM/videos

    If I answered your question, please accept it as a solution 😘

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 612

#2
Valantis Profile Picture

Valantis 344

#3
11manish Profile Picture

11manish 326

Last 30 days Overall leaderboard