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 / Perform a series of ac...
Power Automate
Unanswered

Perform a series of actions for each item in a column

(0) ShareShare
ReportReport
Posted on by 697

Hello,

 

I don't know if this is possible but I thought I would ask. I have a dynamic number of links on a page in a single row, that looks like this. 

CharlesBrewer_0-1652372373824.png

Each of those RA-xxx numbers are hyperlinks. I need automate to be able able to recognize each of those, and click on them, which opens a new window with another URL : 

CharlesBrewer_1-1652372478189.png

Which then opens up another page I need to do a Control +S on to save, and then I'm hoping to be able to email those files and then delete them.

 

Is this possible? My initial thought was to have it extract the URLs in the column, and then do a "For Each" loop and have it open the url in the browser, do the clicks and saves and then close them.  But, the extracted URL is not the same as the URL that goes to the next window, it just takes me back, so I would need to do the physical clicks, but it would need to go down the column and know how many there are.

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    so I would need to do the physical clicks, but it would need to go down the column and know how many there are.

    Are you able to use the web recorder which will give a skeleton of code for doing the physical clicks and then tweak the code to do the same for all the other links?

    The count of rows will be given by doing the count on the datatable %DataFromWebPage.RowsCount%

  • CharlesBrewer Profile Picture
    697 on at

    I can use the web recorder yes, but I do not know how to tweak the code, as you put it.

  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    It is possible.

    Don't use the recorder; it is garbage. Add your UI elements and actions manually.

    This is (most likely) what you can do:

    1. Add one of the links as a UI element.
    2. Open the editing screen of the selector of the UI element.
    3. Observe the structure of the selector.
    4. Activate the Ordinal property of the a element, which is probably at the bottom of the hierarchy.
    5. Put 0 as the value.
    6. Test that Click link action is able to activate the first link.
    7. Put 1 as the value.
    8. The action should now activate the second link.
    9. Add an incremental Loop, and put the Click action inside.
    10. Edit the UI element selector again. Hit the the bottom left toggle, so it goes to the left and says Visual editor.
    11. Instead of a static numeric value, add the %LoopIndex% variable.
    12. The loop should now be able to cycle through all the links and click them.
    13. If you know the exact amount of links every time, you can adjust the values in the Loop action.
    14. If you're not sure, you can use an If web page (does not) contains action to trigger an Exit loop action, once all links have been visited.

    My friend Thomas made a video that covers some of the technique.

    Power Automate Desktop - advanced UI elements - YouTube

    Skip to minute 6 if you have to.

     

  • CharlesBrewer Profile Picture
    697 on at

    Okay so I got through the first 8 steps there no problem. I'm trying to do the loop, and as a simple test I'm just trying to have it open the first link, then close the window, then hopefully open the 2nd. It opens the first but it can't seem to then Close the window.  :

     

    CharlesBrewer_2-1652724994820.png

    I assume I need some sort of Browser2 variable for it to recognize the popup. The question how to do so, considering the URL of the popup is not static, nor does the URL match the extracted URL from the "Anchor" I am clicking on. I hope that all makes sense?

     

     

     

  • CharlesBrewer Profile Picture
    697 on at

    I should mention I tried to do the Recorder for this also, in which case I tried to do it out of the loop to just to see if I could do it once, and it looks like this :

    CharlesBrewer_3-1652725618081.png

    But it  breaks on the Launch new Chrome window (I do obviously have the add-on)

    CharlesBrewer_4-1652725743286.png

    I'm not sure that would work anyway because the URL is not going to b static like I said, in fact I think that's what's breaking it, that ID at the end changes. Is there a way for it to recognize the "chrome window in the front" or some such, I'm a bit lost on this one.

     

  • CharlesBrewer Profile Picture
    697 on at

    So small update as my day is coming to an end. I tried a 'launch new window' and tried to use the title :

    CharlesBrewer_0-1652735053242.png

     

    And then I did a "Click link on web page" after, so the flow looks like this :

    CharlesBrewer_1-1652735090886.png

    So the funny thing is, it is working. It clicks on the link, the popup opens, and then it clicks on the "Close" button. However Automate is reading it as a failure

    CharlesBrewer_2-1652735149875.png

     

  • CharlesBrewer Profile Picture
    697 on at

    Though I can possibly ignore the error above, that' not what I want it to do anyway. I want it to click on the "Tag Document" link and I can't get it to do so. I even tried to do a Data Extract on it but the URL doesn't show as an option, very odd 😕 Clicking though should be something I can do

  • CharlesBrewer Profile Picture
    697 on at

    So I still cannot get it to click on the "Tag Document." I am trying to manually create the UI element, and I am likely doing it wrong.

    CharlesBrewer_0-1652983175900.png

    So there are the 3 steps. It clicks on "Anchor 5" just fine, which then opens up a popup. So I did that "Launch New Chrome window" and I set the options as follows : 

    CharlesBrewer_1-1652983235336.png

    I assume I had to make a new Browser variable to get it to recognize the popup.

    In the popup I need it to click on this link :

    CharlesBrewer_2-1652983296638.png

    I tried to do "Add UI element" however I cannot get it to select anything in this box. So I did a record and deleted what it had, since it did not work anyway. I took a look at the html, which looks something like this.

    CharlesBrewer_3-1652983428561.png

    So I changed the Anchor 6 selector to this :

    CharlesBrewer_0-1652994397264.png

    This of course did not work, I get an error that the element is not found. Any thoughts on which I could try instead, or am I doing something else wrong completely?

  • VJR Profile Picture
    7,635 on at

    In the html it shows as Class Title but your anchor 6 only says Title. So try changing that. Make sure spacing, upper/ lower case everything is right.

     

    Also speaking of recording, if the above does not work, after you record there will be a separate UI elements section pertaining to the recording on the right hand side.

    Open it and share screenshots of as much as possible of all the attributes of the UI element.

  • CharlesBrewer Profile Picture
    697 on at

    Assuming I did this right, same error

    CharlesBrewer_0-1653053341349.png

    That was the original recorded UI element, but recording again, this is what it looks like :

    CharlesBrewer_1-1653053469991.png

    I'm not able to open a Visual editor on this one, just the above.

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 953

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 622

Last 30 days Overall leaderboard