Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Get second element

(0) ShareShare
ReportReport
Posted on by 10

Hi Guys,

 

I am using the below to get the first element from a "recognise text in image\PDF" output, is there a similar expression to get the second element? 

 

dmgc_0-1695810634332.png

 

Many thanks

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Get second element

    Hi @dmgc 

     

    If you want to merge the elements of both select results, then you can use createArray function. In the below expression, I have merged the results of 2 select actions with name 'Select 2' & 'Select 3' in compose action:

    createArray(body('Select_2'),body('Select_3'))

     

    This will return the following result in compose action:

    [

        [

            "I am the first page in the PDF. I am some junk text that I do not need, this",

            "I am another page. I am some junk text that I do not need, this can be"

        ],

        [

            "12341234",

            "43214321"

        ]

    ]
     
    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.
     
    Thanks
  • dmgc Profile Picture
    10 on at
    Re: Get second element

    @ManishSolanki @Expiscornovus , both work well, thanks.

     

    As an aside, is there any expression to select First and Second element at the same time? Would save join operations that I am struggling with, seems the join goes badly for me! The join converts each array to string inside a new array element.

     

    Eg:

    Element 0

    [
      "I am the first page in the PDF. I am some junk text that I do not need, this",
      "I am another page. I am some junk text that I do not need, this can be"
    ]
     
    Element 1
    [
      "12341234",
      "43214321"
    ]
     
    Joined:
    [
    ["I am the first page in the PDF. I am some junk text that I do not need, this","I am another page. I am some junk text that I do not need, this can be"]
    ["12341234","43214321"]
    ]
  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Get second element

    Hi @dmgc 

     

    You can try this:

    first(take(skip(item()?['lines'],1),1))?['text']

     

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

     

    Thanks

  • Expiscornovus Profile Picture
    32,155 Most Valuable Professional on at
    Re: Get second element

    Hi @dmgc,

     

    You can use index numbers for this. [0] will also get the first element, [1] will get the second, [2] the third, etc.

     

    So, in your case try:

     

     

    item()['lines'][1]['text']

     

     

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