Loop excel row values based on color

Hi Everyone,

I have data in excel sheet i want to copy those till 1 color as 1 set and another color will be another set. How can i achieve this.

Input :

image

Output:

I want to loop color vise values

for each loop 1 :

159486
326598
851294
328476
235698

for each loop 2 :

953745
398574
832795
658319
435982

for each loop 3 :

284618
759412
186738

Attachment :

Coumn re arrange(AutoRecovered).xlsx (10.9 KB)

Hi @postwick I don’t know how many color rows will be available in my sheet. If i go row by row and doing color match it will be lengthy and difficult process i guess but i will try this once. Do we have ant alternate way to do it.

You could create a datatable with the same columns as the Excel file, plus a row for color. In your For Each Excel Row you use Add Data Row to add the Excel data to the datatable plus the color. Then after that you could loop through the datatable and use Filter Data Table to find all the rows of each color. That would make it so it works even if the colors aren’t all grouped together in the Excel file.

@Vikas_M if you have time please check this also once.

@Learner007

try this way you will get all the values

Hi @Shiva_Nikhil , is there any option to do without specifying the color. Because i don’t know what color i will receive there. If it’s possible to pick any colour that will be good. I will check once again if the color format is same then this will be enough.

@Learner007

if you are not mentioning the colour it is not possible to

identify the output colour by get cell colour activity

cheers

Ok got it will try that once and i will check about the format of that excel also once

@Learner007

ok sure

happy automation

Hi @Learner007 I share you one example to do it colors dinamically, I hope it can help you
LoopbyColor.zip (9.9 KB)

Hi @Benjamin_Vazquez1 Do you have this code in VB and i’m not using modern design flow also. When i try to create same flow separately it is throwing me error.

Hi @Shiva_Nikhil if ossible can you please shre me this XAML.

@Learner007

getcolours.zip (177.3 KB)

if any issues let me know

Thank you @Shiva_Nikhil

1 Like

@Shiva_Nikhil I’m getting like this is there any issue with version, I’m using latest version 2023.4.1

@Learner007

in the

right click on the dependices where you are it is showing error and select repair dependency it will make the changes

Sure, thanks . i will try that

1 Like

Hey @Learner007,

You can try the below XAML for dividing excel cells based on color,

XAML:-
Divide_DataTable_BasedOn_Excel_Color.xaml (18.3 KB)

Excel Sheet:-
ExcelColor.xlsx (11.0 KB)

1 Like