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:
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