Datatable related issue fresher

Hi,
I’m new in UiPath i want to create a data table and they have many column, like first name , last name ,roll no, age, marks … etc.

After creating I also need to filter the data table on basis of one column like marks .
How can i do any guidance/ docs /flow pls.

Hi @RPA_Learner0

Please go through the UiPath Academy and complete associate courses.

For this you can check below official docs, it’ll perfectly match your expectation. Follow all steps.

Happy Automation

1 Like

First, drag and drop the Build Data Table activity from the Activities panel into your workflow. This activity allows you to manually define the structure and contents of a table. In the dialog that appears, you can create multiple columns, such as First Name (String), Last Name (String), Roll No. (Int32), Age (Int32), and Marks (Int32). After defining the columns, you can add a few sample rows directly in the same window to simulate real data. Once done, click OK and assign the DataTable a name like dtStudents.

Next, to filter this DataTable based on the values in one column—such as retrieving students who scored more than 80 marks—you can use the Assign activity. Create a new variable, for example filteredTable, of type DataTable. In the Assign activity, use the following expression:

filteredTable = dtStudents.Select("Marks > 80").CopyToDataTable()

This expression selects only those rows from the original DataTable where the “Marks” column value is greater than 80 and copies them into a new DataTable.

However, note that if no rows match the condition, the CopyToDataTable() method will throw an exception. To handle this safely, you can first check if any rows match using an if condition like

dtStudents.Select("Marks > 80").Count > 0

and then assign only if the condition is true. This ensures your workflow won’t crash due to an empty result.

Also if you found the correct solution then mark this as SOLUTION

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