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 / Click Link on Web Page...
Power Automate
Answered

Click Link on Web Page where id number keeps changing

(0) ShareShare
ReportReport
Posted on by 23

Hi,

I have a flow that runs through various links on a web page table. On clicking this link a pop up table appears where data is extracted. Once completed this pop up table needs to be closed each time before moving on to the next link.

 

The problem is that there is an id number in both the "OK" button and the "X" close button which keeps changing. It's necessary to find this new UI element before clicking on the "OK" or "X" button. These numbers are not necessary sequentially increasing by one and the starting number may not be 1.

 

I've tried using OCR to find OK and left clicking but this didn't work, I also tried finding the "OK" image and left clicking but this didn't work either.... any ideas please?

 

The code for the "OK" button is: div[Id="ui-id-1"] > iframe input[Id="okBtn"]

For the "X" button it is:

> body[Class="MainBody"] > div[Class="ui-dialog ui-corner-all ui-widget ui-widget-content ui-front ui-draggable ui-resizable"]:eq(1) > div[Class="ui-dialog-titlebar ui-corner-all ui-widget-header ui-helper-clearfix ui-draggable-handle"] > button[Class="ui-button ui-corner-all ui-widget ui-button-icon-only ui-dialog-titlebar-close"][Type="button"] > span[Class="ui-button-icon ui-icon ui-icon-closethick"]

 

Mike1976_0-1660825014395.png

 

I have the same question (0)
  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Try removing the id attribute from the OK button selector.

    Where do you see an id in your X button?

  • Mike1976 Profile Picture
    23 on at

    Hi Henrik,

    Within the X button the number within eq(1) > changes . For example this is the X button for the second and fourth... it seems to increment by one each time a pop up is opened, however, I don't necessarily know how many times it's previously been opened to work out the starting point.

     

    > body[Class="MainBody"] > div[Class="ui-dialog ui-corner-all ui-widget ui-widget-content ui-front ui-draggable ui-resizable"]:eq(1) > div[Class="ui-dialog-titlebar ui-corner-all ui-widget-header ui-helper-clearfix ui-draggable-handle"] > button[Class="ui-button ui-corner-all ui-widget ui-button-icon-only ui-dialog-titlebar-close"][Type="button"] > span[Class="ui-button-icon ui-icon ui-icon-closethick"]

    > body[Class="MainBody"] > div[Class="ui-dialog ui-corner-all ui-widget ui-widget-content ui-front ui-draggable ui-resizable"]:eq(2) > div[Class="ui-dialog-titlebar ui-corner-all ui-widget-header ui-helper-clearfix ui-draggable-handle"] > button[Class="ui-button ui-corner-all ui-widget ui-button-icon-only ui-dialog-titlebar-close"][Type="button"] > span[Class="ui-button-icon ui-icon ui-icon-closethick"]

  • Mike1976 Profile Picture
    23 on at

    Hi Henrik,

    I've also tired removing the id as your suggested and got element not found....

     

    Element with selector 'div > iframe input[Id="okBtn"]' not found.
    Element with selector '> iframe input[Id="okBtn"]' not found.

  • Verified answer
    Mike1976 Profile Picture
    23 on at

    Hi Henrik,

    I found a solution.... 

    When you select an item first from the table the div[Id="ui-id-1"] then when the second item is selected the id =4, third =7. When you close the browser and go back in then the id is reset to 1. So therefore  I have created a variable which increases by 3 each time an item from the table is clicked. This has resolved the situation.

     

    Thanks for taking the time to reply.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 298 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 159 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 150 Super User 2026 Season 2

Last 30 days Overall leaderboard