How to dynamically type into a browser table row based on DT extract value

Hi,

I’ve extracted a DT from a browser table and saved column 1 row values (column 1 in red box below). Using a for each row in DT I am struggling on how to type in the corresponding row in column 5 (green box). For example column 1 row 1 = dog, I’d like to enter a value in column 5 row 1. If column 1 row 4 = cat, I’d like to enter a particular variable value into column 5 row 4. The selectors are producing multiple tableRow elements which might be where it is going wrong too. I’ve tried to add a variable of rowIndex which is idx+2 but it doesn’t seem to be able to find the correct row dynamically.

Any help would be much appreciated.

Thanks

image

image

Hi

It seems table in table. So the first tableRow is for the outer table, but second tableRow is for inner table. Maybe it’s unnecessary to use dynamic selector either of the 2 tableRow attributes.
Can you try to check the html structure in details.

Regards,

Thanks, not too sure how to tackle this one without a dynamic selector though as the row to be edited in the for each row loop needs to only apply to the one row passed as a variable (eg for each row that equals cat update column 5). Any ideas pls?

HI,

How about ForEachUiElement activity?

Regards,

Hi, any examples of how this could potentially work please?

Thanks

Hi,

The following video may help you.

Regards,

@TRX

You can use a combination of for eqch ui element and the extract you did

  1. First do an extract and save in dt
  2. Now use for each ui element on column 5
  3. Use an if condition inside and use dt.Row(currentIndex)(0).ToString.Equals("Cat")
  4. On then side use type into with input element as currentElement…
  5. Instead of if you can use a switch case or if else as well

Cheers

Thanks for this, next issue I’m facing is the for each UI element is producing an error “target element must be set”. I’ve added the activity within the use application/browser activity and it would appear that the Ui Elements were added successfully.

Any ideas pls?

image

@TRX

May I know exactly where you are getting this error?

Did you happen to indicate the column 5 in the for each ui element?..did it highlight each row of column 5 as separate item?

Cheers

Yeah sure. Getting this error once I hit save and close after using the For each UI Element wizard. I’ve tried to select the whole table and also just column 5 too:

image
image
image

Cheers

@TRX

As per first screenshot i see that the element is not indicated can you check if the properties panel is showing the target selector

Also which version of ui path are you on? Looks like you are a little older version and also not on modern

Cheers

Looks like the target element isn’t saving in the properties each time:

image

Its a pretty old version (2020.10.15) - think this might be the issue?

Cheers

Hi,

Now upgraded to the latest version of Studio but still appears to be producing the error of “Target Element must be set” even though the data is showing when I hit preview after running the wizard.

Any other ideas would be much appreciated.

Cheers
image

@TRX

After indicating did you select save or close?

As per screenshots you provided the target is null and not even set

Cheers