web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : 1dXE27uHgZBCj/PzJnhw31
Power Automate - Building Flows
Unanswered

How to get the 3rd element after doing a split

Like (0) ShareShare
ReportReport
Posted on 17 Mar 2023 19:35:03 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

 

I have the same question (0)
  • Pstork1 Profile Picture
    67,987 Most Valuable Professional on 17 Mar 2023 at 20:07:18
    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,987 Most Valuable Professional on 17 Mar 2023 at 20:06:45
    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 17 Mar 2023 at 19:45:18
    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 17 Mar 2023 at 19:42:21
    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,987 Most Valuable Professional on 17 Mar 2023 at 19:40:09
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 736 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 396 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 339

Last 30 days Overall leaderboard
Loading complete