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 / Get value between last...
Power Automate
Answered

Get value between last en second last delimiter from string

(0) ShareShare
ReportReport
Posted on by 112

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

 

 

Categories:
I have the same question (0)
  • SudeepG Profile Picture
    24 on at

    n

  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    @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'

     

     

  • RobMolenaar Profile Picture
    112 on at

    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

     





  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    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
    112 on at

    Thanks! This solved my problem.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 241 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 179

#3
Haque Profile Picture

Haque 159

Last 30 days Overall leaderboard