Do while prints only 1 result

Hello there,

I have a Do While activity, of which the bot will “Get Text” from the box and keep doing the same until the end of Next button. However, currently I am not sure why the variable only prints 1 out of all in the log message now. May I know how I can log all texts extracted in one variable separated by “|” ?

image

image
image

this is because it is finding only one element

The cell value changes everytime in the loop , so you have to make your selectors dynamic in the “get text” activity so that you get all the elements

Or you can also use anchor base for this (classic activity)

Use a find element activity inside anchor base and then a get text

Regards,

Hi @WS_Chai

Create a variable extractedTexts as string variable outside the do while loop and assign it as Nothing
In Do while:
extractedTexts = extractedTexts + "|" + currentText)

Hi @Supriya117,

Seems like still only one out of all got extracted. Did I do it correctly?

image

Place the log message at outside do while loop. @WS_Chai

@B_H_Akshatha_Pai,

Thank you for the suggestion. Lemme try on this :slight_smile:

1 Like

@supriya117,

Just tried, seems like it is the same?
Feel free to correct me.