Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

How to get the 3rd element after doing a split

(0) ShareShare
ReportReport
Posted on by 3,502

I have this formula to concat and get the last element after doing a split:-

 

 

concat(body('GetRootFolder')['d']['ServerRelativeUrl'], '/', 'Closed','/',last(split(items('Apply_to_each'),'#;')))

 

but my question is how i can get the 3rd element inside the split array instead of the last element ?

 

johnjohn123_0-1679081665962.png

 

  • Pstork1 Profile Picture
    67,039 Most Valuable Professional on at
    Re: How to get the 3rd element after doing a split

    What was the error that you got?  The syntax might be off by a bit or the item may not have 3 or more parts after the split.  But here's an example of it working with a Split.

    image.png

  • Pstork1 Profile Picture
    67,039 Most Valuable Professional on at
    Re: How to get the 3rd element after doing a split
    items('Apply_to_each')

    is JSON notation.  Everything in Power Automate is stored as JSON.

  • johnjohn123 Profile Picture
    3,502 on at
    Re: How to get the 3rd element after doing a split

    @Pstork1 i tired applying your formula but got an error.. again i do not have a json

     

  • johnjohn123 Profile Picture
    3,502 on at
    Re: How to get the 3rd element after doing a split

    @Pstork1  thanks for the reply,, but i do not have a json, the value is inside an array and i am accessing the array inside an Apply_to_each

  • Pstork1 Profile Picture
    67,039 Most Valuable Professional on at
    Re: How to get the 3rd element after doing a split

    You can add an zero based integer Index to your JSON in place of the last()

    concat(body('GetRootFolder')['d']['ServerRelativeUrl'], '/', 'Closed','/',split(items('Apply_to_each'),'#;')[2]))

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June 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 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1