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 / How to handle UI eleme...
Power Automate
Answered

How to handle UI elements with dynamic(random) IDs?

(0) ShareShare
ReportReport
Posted on by 106

Hi everyone,

 

I’m currently working on a Power Automate Desktop (PAD) flow to automate input/search on a website. ( I attached the image of where I want to input name to search)

 

However, I’m facing an issue with UI elements.

 

The selector looks like this:

input[id=“jqxWidget5f08ce746fc5”]

 

The problem is:

 

  • The ID appears to be dynamic (random) and may change

  • Because of this, the UI element is unstable and sometimes not detected

  • If I delete this dynamic attribute, there is nothing left in the selector, so PAD cannot identify the element at all

  • As a result, the automation does not proceed

I tried these:

・I also tried re-capturing the UI element multiple times, but the ID looks similar each time and I’m not sure if it’s reliable

・I also tried Click + Send keys actions but same ID

・I also tried populate text field action and it is also the same ID

and these IDs are always errors or the automation stops and do not proceed.

 

I'm a beginner so step by step guide is really appreciated

inputname.png
I have the same question (0)
  • Verified answer
    Haque Profile Picture
    2,952 on at
     
     
    Look for attributes like: name or class or placeholder or type="text"
     
    Use this expression:
    input[type="text"][placeholder="Enter name"]
    These are often more stable than dynamic IDs.
     
     
    Also, as PAD selector support wildcards and contains logic, we can use partial attribute matching too. Hence, instead of matching the full dynamic ID, match the stable prefix.
     
    If we use this for starts with:  input[id^="jqxWidget"] | (^= means “starts with”)
    for contains: input[id*="jqxWidget"] | (*= means “contains”)
     
    This way, even if the suffix changes, the selector still works.
     
     
    One more option can be selecting hierarchical attributes (Parent and then children) if the input field is inside a stable container (like a div with a fixed class), for example
     
    div[class="searchBox"] input[type="text"]
     
    Searching the class 'searchBox' inside that, looking for the input type 'text'.
     
    Please let me know if these clues help.
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
  • Verified answer
    cwischnewski Profile Picture
    162 on at
    Just replying to add a few further details on starting out with web based PAD CSS selectors.  You will likely need to get a little familiar with the html of the page you are trying to automate.  If you right click that input box you should be able to select "Inspect" from the context menu.  From there, you should be able to find your element and see any other attributes on that input element.
     
    A helpful place to learn more about the html that underlies the UI Elements you are working with is the W3Schools HTML tutorial: https://www.w3schools.com/html/default.asp
     
    Next thing to get familiar with is how to edit the UI elements in PAD itself.  So after you capture the element it is sometimes necessary to edit what was captured.  So starting from the UI element list, double click that one that was captured to open the element editor.  The middle portion of this has three areas, left most is the list of selectors (you can actually define many different selectors all to try to find the same element, for now stick to the default one.)  Center section is the list of the element tree found down to the input you listed as the bottom one.  You can check the box of any of these to add it to the logic of finding your input.  So maybe the element above your input is a div that has something more unique to help find this input.  When you click on one of these elements, PAD will show you the attributes it found on the right most part.  Here you can change things like "Equal to" to "Contains" to look for Widget, for instance.
     
    This page should help give you more on customizing the selectors: https://learn.microsoft.com/en-us/power-automate/desktop-flows/build-custom-selectors
  • CU10030357-0 Profile Picture
    106 on at
    Hi @Haque
     
    thank you for always helping me, you've been a great help!! I will try it. I might ask more questions because this is the top problems I'm facing right now in PAD. again thank you so much.
  • CU10030357-0 Profile Picture
    106 on at
     
    thank you so much, I will definitely look into your link that you recommended, I'm facing this problem all the time, and I appreciate any recommended study links, tutorials or reference, thank you so much.
     
  • CU10030357-0 Profile Picture
    106 on at
    Hi @Haque
     
    I tried every options you recommended, it works but When I run my flow, the automation clicks on the wrong part of the screen, or the dropdown/input does not behave correctly. I think the selector is too general and the selector matches some of the buttons on the page, or similar elements, multiple elements exist. I hope you could help me, any advice or knowledge is really appreciated.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 1,027

#2
Valantis Profile Picture

Valantis 815

#3
Haque Profile Picture

Haque 630

Last 30 days Overall leaderboard