How to capture all the rows with the same column value in Excel?

Hi. I just want to know how do you capture all the data in a specific row with the same column value?
Here’s how my workbook looks like:


So basically, I’m supposed to group all items with the same Requisition Segment number, and put them in a DataTable to use them later on in my use case. How can I do this?
For example: All under the same requisition description, e.g. 1, all the rows associated with that number will be captured and grouped in a DataTable, but it isn’t always in ascending order. it may get mixed up in a different order such as:

I’m supposed to do a Create Requisition (my process wherein I need to order a bunch of items, depending on the requisition details sent - if they’re on the same requisition segment) So after grouping everything with the same requisition segment, I need to run a process, then after that process, I need a loop wherein I should create another requisition for the next set of same requisition segments, it goes on until I finish all the segments.
I hope that makes sense :sleepy:
Is it possible to do this in UiPath?

Disclaimer: I apologize as I am just new in UiPath and still trying to learn, I’ve read a lot of documentations but to no avail.

You can read the excel data into a data table using read range activity.
The output will be in a data table.

Use Remove Duplicate Rows activity to remove the duplicate values from a data table.
So the final data table contains only one row for each requisition segment.

Hope it helps.

Regards,
Karthik Byggari

1 Like

Hi Karthik, my aim is to capture all duplicate values and use them as reference to initiate the following process to create the requisition.

It kinda goes like this:

  1. Capture all with the same requisition segment.

  2. Use the entire row of the ones with the same requisition segment (all 1s for example) and use them as reference to purchase requisition

  3. Proceed to the next requisition segment (all 2s) and repeat until I clear all segments.

Hope this makes it a lot more clearer.

Thanks for making time for this

Regards,
Mc
EDIT: I just don’t have any idea as to how am I supposed to make a logic statement out of this (Flowchart, sequence, if else structure)

Okay. In that case,

  1. Get the unique Requisition Segment IDs. ( something like this DataView.ToTable(false,"Requisition_Segment"))

  2. Filter the data table for each segment ID, for each ID in dtUniqueIDs
    You can use either Filter Data Table activity or the following expression
    if ID is integer filterDataTable = yourDataTable.Select("Requisition_Segement=" + ID + "")
    if ID is string filterDataTable = yourDataTable.Select("Requisition_Segement='" + ID + "'")

Regards,
Karthik Byggari

1 Like

Hi @KarthikByggari !

I don’t quite get your response above, please bear with me as I don’t have much experience in both .NET and UiPath (still trying my best to learn):

  1. Get the unique Requisition Segment IDs. ( something like this DataView.ToTable(false,"Requisition_Segment") )
  2. Filter the data table for each segment ID, for each ID in dtUniqueIDs
    You can use either Filter Data Table activity or the following expression
    if ID is integer filterDataTable = yourDataTable.Select("Requisition_Segement=" + ID + "")
    if ID is string filterDataTable = yourDataTable.Select("Requisition_Segement='" + ID + "'")

Here are my questions:

  1. In no.1, you said that I should get the unique requisition Segment IDs right? Does that mean I should use the assign activity then assign a variable e.g. filterRequisition = DataView.ToTable(false, “Requisition_Segment”)?
    Please refer to Picture 1.A
  2. And in no. 2, should I use a filter data table activity or a flow chart with a flow decision activity? Which of the two activities would be better to use? Assuming that I create a variable called filterDataTable, how am I supposed to fill these up? Please refer to Picture 1.B

Picture 1.A

Picture 1.B

Basically, this is how my workflow currently looks like:

Picture 1.C
image
1.) Read DataTable Sign In Details - the excel where the sign in details are stored
2.) Read DataTable Req. Segment - the excel where the requisition segment details are stored.
3.) Sort/Filter Data table (There’s nothing inside here yet, this is where I plan to put the mentioned activities above).
4.) Purchase requisition using the dataTable reference.

I hope I explained this clearly, but please do tell me if you didn’t. Also, I apologize for the late reply, I tried to do and study the suggestions you mentioned for the last few days but I still don’t quite get it. Please bear with me as I really want to learn this, also thank you for the time you are giving by reading and responding to my post, I really appreciate it.

Looking forward to your response,
Regards,
Mc