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

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,394 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
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 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

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard