cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CharlesBrewer
Responsive Resident
Responsive Resident

Perform a series of actions for each item in a column

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.

24 REPLIES 24
VJR
Multi Super User
Multi Super User

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
Responsive Resident
Responsive Resident

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

Henrik_M
Super User
Super User

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
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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?

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
Responsive Resident
Responsive Resident

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.

CharlesBrewer
Responsive Resident
Responsive Resident

Been trying different things today and still no go, which leads me to a question : Does the link to click on have to actually be visible? Like do I need to make power automate scroll down first, or can it click on the link without scrolling down?

If you are doing it by capturing the UI element, then it need not be visible.

Another option you can try is - Find any other nearby element that can be identifiable using UI elements.

For example, the "Dealer comments" textbox -> Click inside it -> and then using sendkeys press TAB which will take you to the hyperlink -> and then press ENTER.

At first you can check the sequence and the keys by doing it manually and then mimic the same via PAD.

CharlesBrewer
Responsive Resident
Responsive Resident

That's a pretty cool idea, I didn't think of that. However, still not working. I could not get PAD to recognize the textbox for some reason, both through recording and through trying to manually add a UI element. So instead I did the "h2" header above the link. I tested manually and it worked, but on the flow I get an error as always that it can't find it, I don't get it.  Finally the only way I was able to get it to work was to do a 5 second delay, then in "foreground window" hit tab 14 times and Enter 😄

CharlesBrewer_0-1653414844812.png

I might up the delay to 100 or so, other than that, it's working and I will have to go with it.  Now I just need to do the next step of Saving...and figure out how to loop that for each item in the column, which I'm sure will be fun and I'll be back for 😛 I really think it's just something weird with the code on this particular window, because I have a lot of trouble choosing any UI elements inside this DIV.

CharlesBrewer
Responsive Resident
Responsive Resident

So I think I got it, for the most part. I need to add in a couple delays, especially between the 14 tabs heh cause it messes up a little bit, but that's no biggy. Just to double check my work if you don't mind. So here is my process :

CharlesBrewer_0-1653428722114.png

I don't know if all the tabbing and the mouse clicks is the best way to do it, but this old page is in an iframe and I was having trouble otherwise. This is on a VM so the page location etc is all going to be pretty static.  So then I had to loop it. Here is how I set the loop :

CharlesBrewer_1-1653428801393.png

Originally I had it as "Start from : 0" like I found in youtube videos, but it didn't seem to work, I had to start it from 1. And then for Anchor 5, I set it like so :

CharlesBrewer_2-1653428886380.png

This seems like a bit of a cluster, but I assumed I had to adjust the tablerow (tr), and not the table data (td), and that worked out.  But if there's something that can be done better, please let me know of course.  Otherwise I now have to move onto the fun part of trying to get this loop within another loop, where it will filter by each of our 22 branches and send an email to the correct folks. That will be fun. I'll try it on my own of course, if I can't get it it'll be a new thread tomorrow 🙂

VJR
Multi Super User
Multi Super User

For reference SendKeys {TAB:14} would send it 14 times. Adding delay is always a good idea when sendkeys is used.

CharlesBrewer
Responsive Resident
Responsive Resident

Ah good to know! That ended up not working anyway because it turns out some of them have more fields than others. So I need to find something consistent, but I'm getting closer at least 🙂

CharlesBrewer
Responsive Resident
Responsive Resident

So what I tried to do to get around it, is click on a UI element below it, and then Shift+Tab to go up from there 4 times. I tested manually, and it worked. However doing it in Automate goes somewhere completely else, and I am confused why? I even tried just 1 Shift + Tab, and it's not going up at all. It's not going down, either, it's going in a weird direction which confuses me.  I am doing {Shift}({Tab}) which should be right? Seems like a simple thing but it's driving me crazy now 😞

I don’t know if this will help, but try:

{LShiftKey}({Tab})

 

also, if that doesn’t work, try that with “use hardware keys” option flipped. 

good luck. 

----
If my post has answered your question, please thumbs up and mark this post as a solution.

I also offer paid consulting services. If you would like to discuss this option, please feel free to DM me and we can set up a time to join a Zoom call and fix any issues you are having.
CharlesBrewer
Responsive Resident
Responsive Resident

My bad I should have mentioned I tried both of those things already, I was in a bit of a hurry last night. Oh well I'll try random things today, cross your toes for me.

Helpful resources

Announcements

April 2024 Commnuity Newsletter

We're pleased to share the April Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.    COMMUNITY HIGHLIGHTS   Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon   LATEST NEWS   Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand inside Charles Lamanna's latest cloud blog.   This is your one stop shop for all the latest Copilot features across Power Platform and #Dynamics365, including first-hand looks at how companies such as Lenovo, Sonepar, Ford Motor Company, Omnicom and more are using these new capabilities in transformative ways. Click the image below to watch today!   Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year on 18-20th September 2024 at the MGM Grand in Las Vegas!   Come and be inspired by Microsoft senior thought leaders and the engineers behind the #PowerPlatform, with Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab and Leon Welicki already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes of Lisa Crosbie, Victor Dantas, Kristine Kolodziejski, David Yack, Daniel Christian, Miguel Félix, and Mats Necker, with many more to be announced over the coming weeks.   Click here to watch our brand-new sizzle reel for #PPCC24 or click the image below to find out more about registration. See you in Vegas!       Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the image below to find out more!   UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place on 21-23rd May 2024 both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI.   There's a serious wealth of talent speaking across the three days, including the likes of Satya Nadella, Amanda K. Silver, Scott Guthrie, Sarah Bird, Charles Lamanna, Miti J., Kevin Scott, Asha Sharma, Rajesh Jha, Arun Ulag, Clay Wesener, and many more.   And don't worry if you can't make it to Seattle, the event will be online and totally free to join. Click the image below to register for #MSBuild today!   European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazing European Collaboration Summit, which takes place in Germany May 14-16, 2024. #CollabSummit2024 is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes of Vesa Juvonen, Laurie Pottmeyer, Dan Holme, Mark Kashman, Dona Sarkar, Gavin Barron, Emily Mancini, Martina Grom, Ahmad Najjar, Liz Sundet, Nikki Chapple, Sara Fennah, Seb Matthews, Tobias Martin, Zoe Wilson, Fabian Williams, and many more.   Click the image below to find out more about #ECS2024 and register today!     Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everything TechCon365 has to offer at the Seattle Convention Center on June 3-7, 2024.   This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes of Nirav Shah, Naomi Moneypenny, Jason Himmelstein, Heather Cook, Karuana Gatimu, Mark Kashman, Michelle Gilbert, Taiki Y., Kristi K., Nate Chamberlain, Julie Koesmarno, Daniel Glenn, Sarah Haase, Marc Windle, Amit Vasu, Joanne C Klein, Agnes Molnar, and many more.   Click the image below for more #Techcon365 intel and register today!     For more events, click the image below to visit the Microsoft Community Days website.      

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!

Tuesday Tip: Getting Started with Private Messages & Macros

Welcome to TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   This Week's Tip: Private Messaging & Macros in Power Apps Community   Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member!   Our Knowledge Base article about private messaging and macros is the best place to find out more. Check it out today and discover some key tips and tricks when it comes to messages and macros:   Private Messaging: Learn how to enable private messages in your community profile and ensure you’re connected with other community membersMacros Explained: Discover the convenience of macros—prewritten text snippets that save time when posting in forums or sending private messagesCreating Macros: Follow simple steps to create your own macros for efficient communication within the Power Apps CommunityUsage Guide: Understand how to apply macros in posts and private messages, enhancing your interaction with the Community For detailed instructions and more information, visit the full page in your community today:Power Apps: Enabling Private Messaging & How to Use Macros (Power Apps)Power Automate: Enabling Private Messaging & How to Use Macros (Power Automate)  Copilot Studio: Enabling Private Messaging &How to Use Macros (Copilot Studio) Power Pages: Enabling Private Messaging & How to Use Macros (Power Pages)

Tuesday Tip: Subscriptions & Notifications

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!   This Week: All About Subscriptions & Notifications We don't want you to a miss a thing in the Community! The best way to make sure you know what's going on in the News & Announcements, to blogs you follow, or forums and galleries you're interested in is to subscribe! These subscriptions ensure you receive automated messages about the most recent posts and replies. Even better, there are multiple ways you can subscribe to content and boards in the community! (Please note: if you have created an AAD (Azure Active Directory) account you won't be able to receive e-mail notifications.)   Subscribing to a Category  When you're looking at the entire category, select from the Options drop down and choose Subscribe.     You can then choose to Subscribe to all of the boards or select only the boards you want to receive notifications. When you're satisfied with your choices, click Save.     Subscribing to a Topic You can also subscribe to a single topic by clicking Subscribe from the Options drop down menu, while you are viewing the topic or in the General board overview, respectively.     Subscribing to a Label Find the labels at the bottom left of a post.From a particular post with a label, click on the label to filter by that label. This opens a window containing a list of posts with the label you have selected. Click Subscribe.     Note: You can only subscribe to a label at the board level. If you subscribe to a label named 'Copilot' at board #1, it will not automatically subscribe you to an identically named label at board #2. You will have to subscribe twice, once at each board.   Bookmarks Just like you can subscribe to topics and categories, you can also bookmark topics and boards from the same menus! Simply go to the Topic Options drop down menu to bookmark a topic or the Options drop down to bookmark a board. The difference between subscribing and bookmarking is that subscriptions provide you with notifications, whereas bookmarks provide you a static way of easily accessing your favorite boards from the My subscriptions area.   Managing & Viewing Your Subscriptions & Bookmarks To manage your subscriptions, click on your avatar and select My subscriptions from the drop-down menu.     From the Subscriptions & Notifications tab, you can manage your subscriptions, including your e-mail subscription options, your bookmarks, your notification settings, and your email notification format.     You can see a list of all your subscriptions and bookmarks and choose which ones to delete, either individually or in bulk, by checking multiple boxes.     A Note on Following Friends on Mobile Adding someone as a friend or selecting Follow in the mobile view does not allow you to subscribe to their activity feed. You will merely be able to see your friends’ biography, other personal information, or online status, and send messages more quickly by choosing who to send the message to from a list, as opposed to having to search by username.

Users online (4,518)