Copy all the details that are related to the 1st column

Hello Everyone,

I have an excel file that contains the invoice number on the first column:


What I want is to copy all of the details of the first invoice

then add those data to an another excel just like this one:

after that it will clear the table then paste the details of the 2nd invoice number:
image
I want to do it one at a time. is that possible?

Find the index of the next invoice number(ie the value is available in the first column) - cell 5 .
By using the take function with dt.asenumerable.take(5) this will consider only first 5 rows.

Hello @Gus_Fring
Kindly refer to this Xaml file
Forum_Excel_ExtractInvoice.zip (88.9 KB)
Where The flow is based on column A, and each invoice number creates a separate sheet.

there are several options to implement it. Feel free to pickup this one most matching to your skill set:

  • finding index: for each row / if check and memorizing row index e.g. as the output index from for each
  • calculating the segment start index and length
  • using skip T take method for slicing the table

For each row

  • loop over the rows
  • detect when a segment is starting / ending
  • transfer the datarow from segment, when collecting to a helper datatable

we do know that it can be done quickly but it has to handle specifics e.g. first row, end of loop …

TakeWhile Approach
Vars:

Segmenting:

Writing:

Demo:

Find starter help here:
DTSlice_BySegmentSize_ToTableList.xaml (10.5 KB)

Hello @Gokul_Jayakumar,

It’s working for me thanks but is it possible to use another activity like while loop or of conditiomln instead of flow switch and flow chart? I tried it on my end but i’m having a hard time to use other activity instead of flow switch or flow chart since i’m just a beginner of Ui path. I’ll appreciate your help. Thanks!

Hi @ppr,

Thank you for this. Will surely try this method also.

@Gus_Fring
I think it’s a bit hard, You can drag and drop the Flowchart activity inside the sequence Flow.
image