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 Automate
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

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

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

     

     

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    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

  • dmgc Profile Picture
    10 on at

    @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,091 Super User 2025 Season 2 on at

    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

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

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard