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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Find relative web element
Power Automate
Suggested Answer

Find relative web element

(0) ShareShare
ReportReport
Posted on by 4

Hi,

 

I'm trying to solve RPA challenge from this website https://futureofworkblog.web.app/challenge2021.html on a regular level. I'm trying to get an input element relative to the label class element. In UiPath there is something called Anchor activity that allows interaction with an element relative to another. Is there anything like that available in PAD? 

 

Or is there a way to create a selector that will get one element before? I was able to create selectors that get one element after, but before (previous) wasn't working. 

 

Thank you in advance.

 

  • fraenK Profile Picture
    2,125 on at
  • KrzysztofKa Profile Picture
    4 on at

    I did, but it gets only UI elements after not an element before. I did it some other way, but still being able to capture elements before would a better option.

  • fraenK Profile Picture
    2,125 on at

    Please post your custom selector

  • KrzysztofKa Profile Picture
    4 on at

    Actually, there is nothing custom to it. I just look for the .label after the input, read its content and then look for input. 

     

    #form_container > input:eq(%LoopIndex%) + .label

     

    #form_container > input:eq(%LoopIndex%)

     

    https://www.youtube.com/watch?v=mD5u8D1Fado

  • fraenK Profile Picture
    2,125 on at

    There is no previous element selector in CSS so you'll need to (loop through the input fields) and verify their label before entering anything

  • Suggested answer
    BoredFish Profile Picture
    26 on at
    You shouldn't need to do any looping. Try directly picking the element where the next sibling has what you're looking for.
     
    Something like this:
    input:has(+ label[text="whateverXYZ"])

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 231 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 170

Last 30 days Overall leaderboard