How to make Dynamic Selectors

hey everyone,

how to make selectors that can identify these fields in each row bcz I tried standard selectors and they just overwrite the first row and didn’t work

@Mohammad_Allan

Use anchors to identify these fields

anchors only identify the first row
so whenever I add another row the data gets overwritten the previous one

Hi @Mohammad_Allan

Check the selectors of the row. May be idx of that particular row will be unique. According to that initialize the count at starting and increment the count below. for the next row it will write from the next row.

Regards

1 Like

@Mohammad_Allan

You are adding the data to the fields and then click “Add Row” and then the data is written in the fields and then add row that is the process

Hi @Mohammad_Allan

First you need to use the anchors to identify these fields. After that with the help of RowCount or idx you will be unique selector. According to above line you can initialize the count for RowCount or idx at starting and increment the count. By following the above you will get the unique selector for each row and each field.

1 Like

yes
each field has a unique row\column index when I see the fuzzy selector box as below

SyntaxEditor Code Snippet

<webctrl tableCol=‘2’ tableRow=‘2’ tag=‘INPUT’ />

how can I make use of these indexes ?

[quote=“Mohammad_Allan, post:7, topic:721178, full:true”]
yes
each field has a unique row\column index when I see the fuzzy selector box as below

SyntaxEditor Code Snippet

<webctrl tableCol=‘2’ tableRow=‘2’ tag=‘INPUT’ />

how can I make use of these indexes ?

Here you can take the tableRow as a Counter Variable and increase the counter based on the number of rows.
<webctrl tableCol=‘2’ tableRow=‘“+CounterVariable+”’ tag=‘INPUT’ />

1 Like

Hi @Mohammad_Allan

Try this way:

<webctrl tableCol='2' tableRow='2'+CounterVariable+ tag=‘INPUT’ />

Regards

1 Like

may you provide more details on how to do it since i’m a newbie to RPA :sweat_smile:
like a YT video or sth

do I need to declare “CounterVariable”?
may you provide more details on how to do it since i’m a newbie to RPA :sweat_smile:
like a YT video or sth

HI @Mohammad_Allan

Please check this video to make the selector for your table rows. In this video they are replacing the hardcoded values with the variable on the same way you need to replace your countervariable and increase the counter after the row completion.

what happens after you enter a row of data and click add row.
does the data move down and you always enter in the first row, or does the added row enter above the input row when add row is clicked

the added row enter above the input row when add row is clicked but the data gets overwritten on the same input row (the first row)

1 Like

so using UiExplorer from studio and a blank form, you need to look into one of the text entry boxes .
I have made a simple for in html to demonstrate
image
In the below image of uiexplorer when clicking on the text entry I can see that the text entry is currently on row 2. However when youve added a row this will increment each time a row is added. meaning that the selector for the type into will need to change each time a row is added

Now I have added a row of data, you can see its change to row 3
image


so if you were looping through a datatable of items to add into your sheet you need to have a “counter” variable that each time you add a row it has 1 added to it, you will then use this “counter” variable within the type into the selector

Attached is a simple workflow. This should just run but will give you a basic understanding of what need to happen. You may need to just open the html file and reset the “Use Browser Chrome” and re indicate the target
ForumHelp.zip (8.8 KB)

1 Like

thanks but may you show me how to increment the “rowcounter” in assign activity

This is the intial setting of the counter as I know my data entry row is 2, variable is “int32” type
image

Then each time the “For Each Row” loops the below assign will add 1 to the row counter

thanks mate
it worked

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.