Dears
How To Read one Column and Paste some of its Cells in Row that meet some Conditions?
Thanks in Advance
Dears
How To Read one Column and Paste some of its Cells in Row that meet some Conditions?
Thanks in Advance
Hi,
Follow the below steps
-Built a data table with the required column name
HAPPY AUTOMATION !!!
Thanks a lot @Krishna_547 , I’ve followed your steps and created corresponding workflow but still getting an error : For Each Row: Collection was modified enumeration operation might not execute. ( Workflow Attached
ColumToRowWithCondition.zip (41.6 KB)
)
Hi @hsendel ,
You can also try below approach-
Step1 - Read column from Read column activity.
Step 2 - Iterate each column value one by one in for each activity.
Step 3: Write your if condition in body of loop and start update your value in excel from write cell activity.
Thanks @ermanoj3101 , It’s OK for Step 1 & 2 , but for step 3 nothing is showing that the Write Cell Activity will write horizontally ( row) and not Vertically ( Column) . Please explain more for this step.
Yes it will update vertically if Column is fixed.
But as you have mentioned, you have some if condition through which you have to decide on which column that value should update.
So you can write those value accordingly by giving address as “A1” or B1 or C1 in those if blocks for horizontally.
For vertically it should be mentioned as A+icounter
The Column is Fixed, but the Rows are Changing ( You can refer to Excel Sheet Attached in my above Example). Thx
Hi @hsendel
Hope you are doing good
Pls find the attached xaml
ColumToRowWithCondition (2).zip (10.5 KB)
Cheers
Thanks @Palaniyappan for Asking, hope same for you , long time ago we didn’t hear from you
Regarding your answer, I’m not sure if you understand my exact query, I want to have at the Output Data written in row instead of Column for each array as follows :
Thanks in Advance
@hsendel
we can do it dynamicly with the help of groupBy, dictionary and LINQ
Variables:
Grouping the data by the the first two letters into a dictionary:
retrieving the max length for the longest group:
Preparing the result datatable columnstructure:
Build datatable with first column (ColName: Key), then we do add the other columns:
Finaly we use following LINQ for populating the target DataTable:
Input (Similar to your Excel), GroupDictionary and dtResult:
Find starter help here:
GroupBy_1Col_TransposeMembers.xaml (11.8 KB)
Find some further help also here:
Excellent Explanation @ppr … Well Done , Please tell me How you’re able to print the following :
set a breakpoint or debug stepwise, the use watch or immediate panel
There is a course on debuging in the UiPath Academy which is highly recommendable for this as well
Seems you’re using Pro Edition…I’m using Studio Only
should also be available on Studio without Pro, which version are you using?
Studio 2020.10.7
Anyway @ppr , I will check this Topic on Academy as you said … at least my issue is fixed and I will be able to continue my project. Thanks again for you and all the Team that collaborate on that @Krishna_547 @ermanoj3101 and @Palaniyappan … I’m really appreciate about the JOB you’re doing in UiPath Community … Keep Doing
Should be available
@ppr, Last Query before closing this Topic: I see that for grouping the item you’re using 2 Strings :
(From d In dtData.AsEnumerable
Group d By k=d(0).toString.Substring(0,2) Into grp=Group
Let gl = grp.Select(Function (x) x(0)).toList
Select Tuple.Create(k,gl)).ToDictionary(Function (t) t.Item1, Function (t) t.Item2)
Can you replace this by what is declared whatever it’s length ( Whatever written in Column A in Sheet2 in My Example?