Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Get value between last en second last delimiter from string

(0) ShareShare
ReportReport
Posted on by 97

Hi all,

I can't get a value from a string.

I want the value between the last and second last delimiter.
String example 1:

Quality management system; Processes per department; Academy; External training for contract partners

I want to have: "Academy"

 

String example 2:

Quality management system;Processes per department;Business Commercial;Evaluating collaboration with contracted business customers;Preparing evaluation interview

I want to have: "Evaluating collaboration with contracted business customers"

 

What is the best way to achieve this?

 

Best regards,

Rob

 

 

  • RobMolenaar Profile Picture
    97 on at
    Re: Get value between last en second last delimiter from string

    Thanks! This solved my problem.

  • Verified answer
    ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Get value between last en second last delimiter from string

    Hi @RobMolenaar 

     

    To get the second last item irrespective of items length in the string, pls use the below expression in the 'Compose 3' action:

    first(take(skip(reverse(split(outputs('Compose_2'),';')),1),1))

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • RobMolenaar Profile Picture
    97 on at
    Re: Get value between last en second last delimiter from string

    Hi Sudeep,

    Thanks for the help.

     

    I always want the second last item.


    When I use the compose and split it is working but when I use the expression in the Select action it gives an error when executing the flow.

    Part of the flow:

    RobMolenaar_0-1691050121466.png

     

    Error:

    RobMolenaar_1-1691050153622.png

     





  • SudeepGhatakNZ Profile Picture
    14,376 Most Valuable Professional on at
    Re: Get value between last en second last delimiter from string

    @RobMolenaar ,

    Is it always the second last item you want to retrieve?

    The expression split(YourInput,';') will return you an array with 4 items.

    You can retrieve the second last item using split(YourInput,';')[2]

    SudeepG_0-1691048369101.png

    The above setup will return the value 'C'

     

     

  • SudeepG Profile Picture
    24 on at
    Re: Get value between last en second last delimiter from string

    n

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