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

 

I have the same question (0)
  • fraenK Profile Picture
    2,125 on at

    Did you try this as a custom selector? https://css-tricks.com/child-and-sibling-selectors/#adjacent-sibling-combinator

  • 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

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