Delete the rows where value in “Bill Held” = “Hold” 2. Filter out only “hul” from Brand Name column. 3. Remove “S-“ from Bill No. 4. Create a new column “Returned with Dues”. Add the value present in “Returned” column and “Dues” column and populate that i

1.Delete the rows where value in “Bill Held” = “Hold”

  1. Filter out only “hul” from Brand Name column.

  2. Remove “S-“ from Bill No.

  3. Create a new column “Returned with Dues”. Add the value present in “Returned” column and “Dues” column and populate that in the newly created “Returned with Dues” field.

Hi @Rohit_Kamble ,

Welcome to UiPath Forum.

Is it possible for you to share the Sample File.?

Below are the steps to achieve each of the requested actions in UiPath using a datatable:

  1. Delete Rows Where “Bill Held” = “Hold”:
    You can use the Filter Data Table activity to create a new datatable that excludes rows where the value in the “Bill Held” column is “Hold”. Then, assign the filtered datatable back to your original datatable.

  2. Filter Out Only “hul” from Brand Name Column:
    Similar to the previous step, use the Filter Data Table activity to create a new datatable containing only rows where the “Brand Name” column equals “hul”.

  3. Remove “S-” from Bill No:
    You can use a For Each Row loop to iterate through each row in the datatable. Inside the loop, use an Assign activity to modify the “Bill No” column value by removing the prefix “S-”.

  4. Create a New Column “Returned with Dues”:
    Add a new column named “Returned with Dues” to your datatable using the Add Data Column activity. Then, use a For Each Row loop to calculate the sum of values from the “Returned” and “Dues” columns and populate the new column.

Remember to adjust the column names and datatable variable names according to your specific use case. These steps should help you achieve the desired actions in UiPath! :robot::rocket:

how to Remove “S-“ from Bill No. column name in csv file

how to modify the “Bill No” column value by removing the prefix “S-”.

There are so many ways to do that,

Filter data table to search the string and have it in a DT. Use for each row, inside use assign activity to replace S- to blank string.

yourstring.replace(“S-”,“”)

Hi @Rohit_Kamble

  1. Delete rows where value in “Bill Held” = “Hold”:
    YourDataTable = YourDataTable.AsEnumerable().Where(Function(row) row.Field(Of String)(“Bill Held”) <> “Hold”).CopyToDataTable()

  2. Filter out only “hul” from Brand Name column:
    YourDataTable = YourDataTable.AsEnumerable().Where(Function(row) row.Field(Of String)(“Brand Name”).ToLower() = “hul”).CopyToDataTable()

  3. Remove “S-” from Bill No.:

YourDataTable = (From row In DT.AsEnumerable()
                   Select DT.Clone.Rows.Add(row.Field(Of String)("Bill ID").Replace("S-", ""))).CopyToDataTable()

Add Data Column “Returned with Dues”

  1. Invoke Code:
YourDataTable.AsEnumerable().ToList().ForEach(Sub(row) row("Returned with Dues") = Convert.ToInt32(row("Returned")) + Convert.ToInt32(row("Dues")))

Regards

Capture

here is the sample sheet where I need to remove “S-” from Bill ID

Here is my workflow

Capture
here is the sample data

Hello,

1.Delete the rows where value in “Bill Held” = “Hold”

in filter Datatable activity, you can Remove rows with this business rule.

Remove “S-“ from Bill No. And the new column

Add Data Column with name “Returned with Dues”

For each row in datatable

Activity Update Row Item
Column : “Bill No.”
Row : CurrentRow
value : CurrentRow(“Bill No.”).ToString.Replace(“S-”,string.Empty)

Still in the for each
Activity update row item and same approach, with a string.concat in value

Hi @Rohit_Kamble

Can you try the below

(From row In DT.AsEnumerable()
                   Select DT.Clone.Rows.Add(row.Field(Of String)("Bill ID").Replace("S-", ""))).CopyToDataTable()

Output:

image

Cheers!!