I’m using Power Automate Desktop to populate data into fields in a program from a spreadsheet. I’ve created UI elements for all required fields. I’m able to run the flow successfully, but when I close and reopen my interface, it no longer can find my UI elements. I don’t want to create new UI elements every time I open the program, is there a fix for this?
hi @as300d that is because the web developer add some javascript to generate ramdom Ids on the elements. So the obky wayt to get those elements is using javascript.
There is an action on power automate desktop called. Run a javascript query
Proud to be a Flownaut!
So you are saying whoever developed the program I’m using used JavaScript to randomize these fields? Power Automate won’t work with this program without JavaScript?
Hi @as300d
I have moved your post from Building Flows to a forum specific to Power Automate Desktop.
Can you share some details of what kind of Ui elements are they.
Also I assume you are referring to Web application and not a windows one.
Also did anything change recently like - new PAD version, etc?
Hi @VJR, thanks for the reply. The application I’m using is not web based, but does run using Java. Best I can explain is it’s an inventory system for a telecom company, it has text fields in which I can update with text data. The UI elements I’m having trouble with are those text boxes. I’m using “populate text field in window”. I can open PA and choose new UI elements (overriding the previous) and it will work, but I feel there should be a way around this. I’ve looked at the selector builder and notice there is always some value different from a previous UI I’ve chosen, even though it’s the same text field in the application.
" I’ve looked at the selector builder and notice there is always some value different from a previous UI I’ve chosen, even though it’s the same text field in the application. "
Herein lies the solution, you will need a dynamic selector.
You can post the screenshot of the before and after as there's nothing confidential within this code, would help solve your issue.
Like this...
Hi @UK_Mike, I'll attach screenshots below, but I'll also attach the code related to them as I think it may be easier to analyze that.
Original selector: > frame[Name="Granite Inventory v16.1.0.00 : P2811433 -> ise"] > root_pane > layered_pane > panel > split_pane > panel:eq(1) > panel:eq(2) > page_tab_list > page_tab[Name="Shelf"] > split_pane > panel:eq(0) > panel:eq(0) > text
New Selector: > frame[Name="Granite Inventory v16.1.0.00 : P2811433 -> ise"] > root_pane > layered_pane > panel > split_pane > panel:eq(1) > panel:eq(1) > page_tab_list > page_tab[Name="Shelf"] > split_pane > panel:eq(0) > panel:eq(0) > text
panel:eq(1) > panel:eq(2)
panel:eq(1) > panel:eq(1)
Thats the only difference I can see in both of those, try deselecting these as they " may " not be needed, see what happens.