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 point PA to cor...
Power Automate
Answered

How to point PA to correct UI elements when URL changes

(0) ShareShare
ReportReport
Posted on by 7

Hi all,

 

I'm a novice user of PowerAutomate with no HTML background. I've been playing around with PA Desktop's record tool and was able to build a flow that achieves what I want to do satisfactorily. The problem is that it is extremely fragile. If I make any changes to the URL of the site I'm working it at all, every single one of my actions needs to be edited to show them where the UI element is again using the Add UI Element tool. I'll give some more specifics below but the general question is, how do I write the command in such a way that PA can still find the same UI element in the same place on the page even if the URL has been slightly altered? The beginning of the URL will always be the same, and the tab will always have the same name, but the site uses the URL to store various filter changes I need to be able to use. 

I'm trying to create a hotkey-activated flow that will add a specific set of observation fields to an observation on iNaturalist. I will manually open a modal on the site and navigate to an observation that I want to run the flow on. example.JPG

 

I've got the hotkey-activation working with a loop starting with "wait for shortcut key"; the next step is to attach to a running instance of Microsoft Edge titled Identify · iNaturalist. This stores a variable "Browser". Then it needs to press the "Annotation" button, go to the "Observation Fields" text box, type some text, select the corresponding span below, go down to the selection box below, make a selection, and press the add button. The name and position of each of those UI elements is the same regardless of the URL, but PowerAutomate throws an error if I make any change to the URL, because it isn't finding the UI Element I've told it to look for using the Add UI Element tool.

 

How am I supposed to write the names of these things such that it will always know where they are? I mean that in both ways. I wouldn't know how to write the correct address for the UI element in HTML, but I also don't even see how you could write a custom address in PA at all. The edit function for a Press Button action, eg, only allows me to select UI elements from those I've already added, and I can't change them in any way. 

 

Thank you for any help you can give

Categories:
I have the same question (0)
  • Verified answer
    Megachile Profile Picture
    7 on at

    I was able to achieve this using the "Run JavaScript function" action instead of the press button or focus field actions. I had to get some help writing the JavaScript but it works much more reliably this way.  

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Megachile ,

     

    It seems to be an interesting scenario. Could you please share the JS codes, to help others find them when they need?

     

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 639

#2
Valantis Profile Picture

Valantis 392

#3
11manish Profile Picture

11manish 350

Last 30 days Overall leaderboard