Iterate in Excel using unique values from a column (StudioX)

I have an Excel file for which I am trying filter for each unique assigned user (from Assigned User column) and copy the first few items assigned to them into a different Excel sheet. I am hung up on how to iterate using each unique user name.

In future files there may be more or less unique Users in column D. This is for StudioX just to make it clear. The screen capture below gives an example of what the Excel data could look like. Thanks in advance for any and all help.

Essentially:
-For each unique User in column D, filter their items
-Copy first 2 items assigned to user
-Paste into a different Excel sheet

Capture

One of the solution might be to:

  • Create Pivot Table in order to get the single unique Users list

  • use For Each Row on the column of unique Users created above
    image

  • use Filter on your excel table and set the filter to: Is Equal to: Current Row Unique User

  • use Copy and Paste Range to get where required the filtered content.
    image

I used it to solve very similar issue.

1 Like

I would create a task argument in your automation which is a list of string, this is going to become a list of your unique names.

Then iterate through the rows in the file, for each row you can use an if activity to check to see if the name in the Assigned User column already exists in the list you have. if it doesn’t then you can add it to the list using an Append item to list activity (therefore keeping a record of what users you have already come across) and also perform your actions around extracting the data.

If the name already exists in your list, it means you have come across it before and you can do nothing on that row and move onto the next

I hope this helps

Thank you all for the advice. I’ve marked the answer from Jakub as the solution as it was the first thing I tried and it worked. Thanks for the prompt responses.

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