Using Excel For Each Row

Hi, I’m trying to copy some text that is generated from a web page to Excel. I have a named range in Excel (80 rows) and I’m using ‘Excel For Each Row’. It successfully copies the 80 pieces of text (one at a time using ‘Get Text’) but it places it in the same cell each time. The ‘Save to’ section of ‘Get Text’ activity doesn’t let me select a range to save to, only a single cell. What else do I need to do so it goes to the next row to copy the text?

Hi @brett.j ,

You should use the write range activity in order to write the whole extracted datatable.
Not sure why you are using the For Each Row loop

Best regards,

Thanks Marius. I’m using for Each Row because I thought that’s what I needed to use to run through a set amount of times ie. 80. I don’t seem to have a Write Range activity on my Studio X.

Which studiox version are you using? also which excel package? If you are using an older version this might be the cause of not finding write range.

How is the data presented in the web page? A table? if so you can use extract data table and then write range to write the entire data table to your named range

Hi Horia, Studio X v2019.10.2, Excel 2016.

The web page has a button that when clicked displays some random text. My Excel has a list of 80 user names and I want to generate 80 pieces of text and copy next to each user name. When I run the automation I can see the text is being copied but only next to the first user and does it 80 times.
My automation has:

  • Excel for each row (range specified of 80 rows)
    • ‘Click’ activity button on web page to generate text
    • ‘Get text’ activity to copy generated text but the ‘Save to’ field in this activity can only select one Excel cell and the 80 pieces of text are copied to this cell, overstriking itself each time.

Can you upgrade studiox? 19.10 is one of the first versions of studiox and you are missing lots of it’s capabilities. Upgrade at least to 20.4 version.
Excel package version is the one you see in studiox under package manager

Thanks Horia. Our organisation is in the process of upgrading to 20.4 but hasn’t happened yet. The Excel package I have is 2.7.2.

Ok, you are running a preview version of studiox that is no longer supported and a very old excel package. With 20.4 you are getting the first GA version of the studiox and you will see a tremendous difference. Lots of new activities and much easier way to work with it.