Each row of Datatable to be pasted in the respective row of a table on a browser page

Hello All,
I have a data table with 5 rows(including headers). Need to write each content of each data row in a table which is opened on a website.
If I use ‘For each row’ and write the data, then when the second data row will be fetched it will overwrite the contents on the website table.

I want row 1 of Datatable to be pasted at the respective row of that website table.

How to achieve this? pls, help.

Hello and good afternoon,

The first thing I would check is the selector you are using to enter in data to the website. My guess is that the row count in that selector is not being incremented in your loop which causes the data to be overwritten instead of added below. If you need guidance with creating a dynamic selector I can help you with that if you provide me the selectors for data entry.

Ok, I guess I am getting you. How will I use the rowindex in the dynamic selector.

Like

Selector for typeinto first row on webtable is : "<webctrl id=‘A241N1display’

Selector for typeinto second row on webtable is : "<webctrl id=‘A242N1display’

how to use rowindex from datatable in place of this 1 or 2… Can you show me the syntax…

For example when selecting a row and column with the UIExplore for something and it is in a table format, many time we will get a selector which looks like the following.

column and row

Try selecting your table row with the UIExplore tool and see if you can include table columns and rows and then increment them inside your loop. If that is not possible, you can also try selecting the first row, the second row and the third row and see what the differences in the selector are and then try to create a selector that increments in each loop.

Yeah, did the same. Clearly there is one number that keeps on changing. Now initializing a variable with 1 and will keep on incrementing i inside the loop.
Will let you know if I am stuck at anypoint.

Thank you so much for your help.:slight_smile:

1 Like

Perfect! If you need any help with creating that dynamic selector then I will be back :slightly_smiling_face:

<webctrl id=‘A242N1display’ Now if I want to replace this 1 with variable rowindex, how to do that?

You would create a string variable and a integer variable. Name the string ‘DynamicSelector’ and the integer ‘count’ or other names that gives you information about the variable. Then inside the loop you would assign it like this:

selector

selector2

and increase count inside your loop at then end. Use the ‘DynamicSelector’ variable in the selector space of the activity where you are writing data inside the table.

Also if there is more to your selector, make sure to include the entire selector in the assign ‘DynamicSelector’ step on a single line, no newlines.

Hi, I cannot do this, as row is same but columns are diferent. So not every selector is of <Webctrl id=A241Nidisplay… some are <webctrl id=B_1_xyz…
so ‘1’ is common through out, so just need to replace the dynamic part in the selectors with variable ‘count’
How to do that?

There are two options to try

  1. Try adding in the count variable to each selector individualy and see if that syntax works

<webctrl id=‘A242N"+count.toString+"display’

  1. If that doesn’t work, do multiple assigns where you assign a new selector to ‘DynamicSelector’ before each column to write in and replace the selectors with ‘DynamicSelector’

dynamic selector

Yeah, tried option 1 yesterday, but that syntax was not right.
Will try to do option 2. will assign diff values in same variable before writing into the column.
Thanks.

Should I use DynamicSelector.tostring?

Hi @aishwarya.gupta

The variable in which you will store the selector will be itself of string so no need to use .ToString.

Just put the variable in the properties

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Nopes, it was not working without “.tostring”
It worked now :slight_smile:

Hi @aishwarya.gupta

Heh heh strange.
Within my UiPath it works without .ToString :sweat_smile:

But It is fine that its working now :innocent:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer: