Extract aaname from a table

Hi,

I have a list of aaname (from the document icon column) which i want to extract.
image

How do I incorporate Get Attribute in For each row activity?

it always extracts the first row only:

1 Like

@sophiey

  1. To start with generally for sharepoint we do not use front end we go with office 365 activities…

https://docs.uipath.com/activities/docs/about-the-microsoft-office-365-activities-pack

  1. If you still want to go with frontend…then please use a selector which is common across the files…and use a idx attribute to increment from 1 to the maximum number of files for your case 3…so for each iteration idx can be changed or a variable can be used and we can get the next file

Eg: this will get the second file…right click on the number two and you will be able to select a variable inplace of 2…and for loop properties has an index property to which a variable can be assigned and that can be used inplace of 2 …remember for loop index starts from 0

Hope this helps

Cheers

@sophiey

As it is not iterating the rows, that’s why you are getting only one row

You need to fine tune your selector, find any selector that has rownumber somthing like that

You can find that changing from 1 to 2 like that

If so you can declare a Index variable of the properties of For Each

Index Varaible auto increments the number, but it starts with 0

So if you number starts from 1 you can assign Indexvariable as IndexVariable + 1

Hope this may help you

Thanks,
Srini

Hi

I got an example with a sample xaml on similar scenario

Hope this would help you

Cheers @sophiey

Hi @sophiey

Try with the below steps

  1. Create a new sequence and drag the Attach Browser activity onto the workflow.
  2. Use the Find Children activity to find all the elements that match the table rows. Set the “Selector” property of the activity to a selector that targets the table rows.
  3. Use a For Each loop to iterate through the collection of child elements returned by the Find Children activity.
  4. For each child element, use the Get Attribute activity to extract the aaname attribute. Set the “AttributeName” property of the activity to “aaname” and the “Selector” property to the current child element.
  5. Store the extracted aaname attribute in a collection or write it to a file, depending on your requirements.

Regards
Gokul

Hi @sophiey - Since the data listed in a sequential manner, the selector would give as a table format. Can you try below steps

  • Identify the first element under document icon column
  • Check the selector, assuming it has row value (say 2).If this is the case then make sure your selector has row value, table=td but not aaname. Now start implementing below logic

Actual Logic

  • Define variable of type integer (say index) and other string variable (say Exception status)
  • Take while loop with condition as Exception status="True"within that use Get Attribute Activity
  • Assuming the activity has already a row value and it has to be incremented every time to get the next element. So, to achieve this, pass the variable (index) into the row attribute of selector. (Dynamic selectors, ref below link)
  • Enclose this Get Attribute within Try Catch block, within the catch block take assign activity, define as `Exception status=“True”
  • Outside of Try catch / after Get Attribute activity, take assign activity to increment the index variable
  • This way, the while loop runs until it finds the aaname. If it not able to find, as we are trying to update the Exception status variable, it goes back and comes out of the loop.

Studio - Dynamic Selectors (uipath.com)