Excel automation in uipath using activities

Hi
Suppose i have data in excel
ex:-
Name and roll no. Name Roll no. odd/even
abc (67)
xyz (56)
ert (78)
So my question is i want Split the data of **Name ** and Roll no. And By using Switch activity i want whether roll no. is odd /even.
Generate a solution in excel like this:
Name Rollno. Odd/even
abc 67 Odd
xyz 56 even
ert 78 even

Hi,

In this case, we don’t need to use Switch activity. Hope the following sample helps you.

Sample20220819-1.zip (2.9 KB)

Regards,

Hello @Ak_4 ,

You can Achieve this using the following steps.

  1. Do read Range & Store the Data in DT1

  2. Use Build DT and create 3 columns (Name, Roll_Num,Odd_Even) this is your DT2

  3. Use for loop and loop over DT1
    Inside for loop use Add Data row
    in Array Row use this expression :
    {CurrentRow(0).ToString.Split(“(“c)(0).Trim,CurrentRow(0).ToString.Split(”(“c)(1).Trim.Replace(”)”,“”),If(Cint(CurrentRow(0).ToString.Split(“(“c)(1).Trim.Replace(”)”,“”)) mod 2 = 0,“Even”,“Odd”)}
    In DataTable Pass DT2

  4. Now you have the required Data in DT2.

image

Regards,
Rohith

Hi
Thank you for solution
But any how i need to use Switch activity to perform the task.

Hi,

Can you try to replace 3rd Assign with Switch as the following, for example?

Regards,

Thank you for solution

Hi
Thank you for solution .This method also working ,Can you help me this by using Switch activity for odd/even.

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