Find variable in SAP DataTable, if found, then click and highlight row with variable

Dear all,

I have a DataTable in SAP with a varying number of datasets/rows. I have defined a variable (column “Verursacher”, in the Sreenshot example 4501671696), which varies every time the bot is running. What I want the bot to do is to go through the DataTable looking for the variable and if found to click and mark the row in which the variable was found. I already succeded with finding the variable in the DataTable by using each row and assign activity. This is working fine. What I am struggling with is how to click & highlight the exact row in which this variable is found on the left side of the SAP chart.
Can you support? Thank you in advance!

1 Like

@DirkKoch As you already able to find the row, you just need to click on the left side.
You can do the same by using pass the dynamic variable (row counter) to the selector of left side button and wherever u found the match just use click. Let me know if you are getting selector which can be modified by row counter or share the selector

Dear Arpit, this is what the Selector within the Click activity looks like at the moment:

1 Like

@DirkKoch please replace tableRow attribute value to your variable by right clicking on the value and choose your roe counter variable

The variable is called “Umlagerungsbestellung”. Once I have integrated the variable, I get a validation error (see Screenshot). Is something wrong in the syntax?

1 Like

@DirkKoch After replacement selector is getting validated against your variable.
Please check your variable value e.g. If your variable value is 0 or 1, selector will be validated against 1st and 2nd row of data table respectively

Hi Arpit, the correct table row is changing with each variable value, meaning one time it can be row 10, next time row 2 and the following row 1.
The only thing that is consistent is that the right row includes the variable number.
What exactly do I have to write in the selector (-> …tablerow=‘variable’ /> is not working correctly!)?

1 Like

@DirkKoch In for each loop take one variable e.g. rowCounter (Type Int32) and increase that variable on each iteration (Assign activity -> rowCounter =rowCounter +1) and pass that rowCounter variable into tableRow. so wherever there will be a match it will click that particular row

Hi Arpit, thank you for your patience. I did as you said, but it still did not pick the correct row. See Sequence and Selector below.


1 Like

@DirkKoch rowCounter is a variable
please replace tableRow attribute value to your variable by right clicking on the value and choose your rowCounter variable and also put increment assign activity in else part

Unfortunately I do not get it to work

@DirkKoch Find variable in SAP DataTable, if found, then click and highlight row with variable
The same way you need to replace your variable with the value
How to pass variables in selectors

Hi DirkKoch
I am facing similar issue in Frontend screen.
were you able to find the right option?

I am struggling to click the right row with reference as “No.” Column to proceed further.
My activity is always choosing first row,

image