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 / Web form filling The c...
Power Automate
Answered

Web form filling The correct UI element field

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I just started using PowerAutomate desktop a few days ago and i am kind of a beginner when it comes to these types of RPA so i would really appreciate your input and help.

I am trying to create a flow which mass updates the information in a browser based interface and I reached a point from which I don't know how to proceed.

 

From the image below i need to update only the information in the "Email" field corresponding to a specific site name and operating Unit. This list can always change and it can have more or less lines.

AndreiP87_0-1625054449122.png

 

I was able to perform a crosscheck between the data extracted from the page above and an excel file in order to make sure that the correct "site name" and "operating unit" are selected.

AndreiP87_1-1625055162713.png

 

What I don't know now is, after the robot recognizes the correct row in which the update needs to be performed, how could I tell it to update the corresponding row from the email field?

Normally instead of the display message I would put "Populate text field on webpage" but i don't know how to set it up to choose the correct UI element based on the criteria. Maybe I need to reconsider the approach.

 

Thank you in advance for your inputs.

 

I have the same question (0)
  • tkuehara Profile Picture
    667 on at

    Hi @Anonymous

     

    Usually, I solve these kind of scenarios with a mixed approach using JavaScript and dynamic element selector.

     

    From a macro perspective, it would look something like this:

    1. Use JavaScript to get quantity of rows
    2. Loop from 0 to quantity_of_rows - 1 and perform the populate field action with the desired value

    Note: in your element, you must specify that the element is a dynamic one, example:

    • Usually, you would have a structure like this: [...] > tr:eq(0) > td:eq(9)
    • To make it dynamically, change it to something like this: [...] > tr:eq(%index%) > td:eq(9)

    This way, you can iterate all rows at the desired column. Here's a sample of this approach:

    tkuehara_0-1625060097901.png

    Note: JavaScript returns string values, thus the need of a convert action.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Ty @tkuehara ,

     

    I'm not really experienced in JavaScript but wouldn't this flow populate each field with an email?

    My intention, for example in the image below, is to ignore the first 3 rows because they don't match with the excel file and to populate the new email only for the 4th row.

    AndreiP87_0-1625063657733.png

    this is the information which i can get from inspecting the UI element, so in this example, it should only fill in under input[Id="N29:email:3"]

    AndreiP87_1-1625063917087.png

     

  • tkuehara Profile Picture
    667 on at

    @Anonymous wrote:

    From the image below i need to update only the information in the "Email" field corresponding to a specific site name and operating Unit. This list can always change and it can have more or less lines.


    I suggested a dynamic selector due to the changing nature of your table (a dynamic table, with more or less lines and also the desired row might be the first, second, etc). For example: If you hardcode "fill row 4" but the table gives you 3 rows in a given scenario, it will break your code. If the table indeed returns 4 or more rows, it won't break your code, but you might update the wrong row.

    At least this is what I could understand. Please correct me if I'm wrong.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    You understood correctly. It is most likely me not explaining correctly since I am still trying to grasp the concepts ( i don't have any programing background so javascript is ever more of a nebula - just a few automation using a rudimentary tool to load Data)

    ---------------

    I am trying to figure out these dynamic selectors and how to change them.

    in this case the selector is

     

    tr:eq(1) > td[Class="x1t x50 xk8"]:eq(9) > input[Id="N29:email:1"]

     

    I tried to go for your example to change    tr:eq(1)  to tr:eq(%CurrentSiteOU%) to use the variable with the current row but no results.

    I tried to change    input[Id="N29:email:1"]   to input[Id*="N29:"] still no results

    The only way i am able to write in the email box is id i hard code it and use the selector in this state input[Id="N29:email:1"]

    Could you please show me an example of how they should look like?

    -------------------

    I was also thinking that this loop is enough to get through all the rows. Do i also have to put in the loop that you mentioned? wouldn't it render the first 2 IF conditions useless?

    AndreiP87_0-1625073704298.png

     

  • tkuehara Profile Picture
    667 on at

    Gotcha!

     

    You can do the following in your case:

    tkuehara_0-1625075030977.png

    Those will behave like a row controller.

    In order to properly work, your selector needs to be:

    tr:eq(%row%) > td[Class="x1t x50 xk8"]:eq(9) > input[Id="N29:email:1"]

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried using this selector but unfortunately it is not working. The automation timer is running but it is blocked at this step without giving an error.

    tr:eq(%row%) > td[Class="x1t x50 xk8"]:eq(9) > input[Id="N29:email:1"]

     

    The only way i was able to write something in the field was when i only used the simple selector input[Id="N29:email:1"]

    Since the input field has the same ID but the number at the end differs i was thinking that maybe it is possible to change the number. So instead of input[Id="N29:email:0"] ; input[Id="N29:email:1"] ; input[Id="N29:email:2"] to find a way to change that number using a variable.

    I have tried a few syntax's  but i can't figure it out. I either get an error saying that my text cannot be filled in or the flow is still running at the same step until i stop it.

    Is there a way to put a variable in the input ID selector? and if so what would be the correct syntax?

     

  • Verified answer
    tkuehara Profile Picture
    667 on at

    Yes, you can do it variable, for example: input[Id="%variableName%"] 

    tkuehara_4-1625238106017.png

     

     

    In this case, your variable should be something like this: N29:email:%LoopIndex% (any numeric variable you currently have in your code)

    tkuehara_0-1625237245393.png

    Then you would have something similar to the code below:

    tkuehara_3-1625237673751.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @tkuehara 

     

    This is awesome, It works perfectly.

    Thank you so much for all your help.

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 269 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 184 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 136 Super User 2026 Season 2

Last 30 days Overall leaderboard