How to copy same values into different sheet?


I want output like this
my workflow:

image

My Actual Output:


Sheets are getting created with there name but why there’s no data ?
Can anyone give me the solution for this?

Hi @NervousTuber

Try this expression

For Sheet A
dt.AsEnumerable().Where(Function(r) r(“name”).Equals(“A”)).CopyToDataTable
For Sheet B
dt.AsEnumerable().Where(Function(r) r(“name”).Equals(“B”)).CopyToDataTable
For Sheet C
dt.AsEnumerable().Where(Function(r) r(“name”).Equals(“C”)).CopyToDataTable

Hope this helps

Regards
Sudharsan

Main.xaml (11.0 KB)
Can you make changes to it?

Hello @NervousTuber

These P_O_No are unique?

Regards
Sudharsan

If possible can you send the Excel file ?

Main.xaml (8.9 KB)
Input.xlsx (22.1 KB)

Na P_o_no contains dynamic values

Okay so , the main sheet is sheet1 and from that sheet you need to create seperate sheet for every values is that right?

yeah main is sheet1

Hi @NervousTuber

Here is the updated workflow and output

Main (4).xaml (9.9 KB)
Input (2).xlsx (20.6 KB)

Reason for the error is

  • As per the flow the sheet1 value are stored in the InputDt Datatable
  • You have used same variable InputDt for the filtered datatable (So, What will happened here is the datatable is updated with the new datatable i.e., inputDt will contains only the values of “13677208”)
    - So,in the second loop it is trying to filter with the next value in the updated datatable .Hence it returned empty values

What i have done is :
- Changed the datatable variable (i.e, Created new one)
- After writing in the sheet cleared that particular datatable (Note : It will also work even if the datatable is not cleared )

Hope this Helps

Regards
Sudharsan

And You can use filter datatable as well

I have checked its also working fine

If your expected results came kindly mark the appropriate solution so that it can be useful for others

Happy Automation and Advance Happy New Year :boom:

Regards
Sudharsan

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