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 / 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,506

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,195 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
    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

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

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard