we have an application where the user creates a datatable with 5 columns.
In a second step the user types into 5 app variables and then we want to add these variables as a row into the datatable. The user can iterate and create again 5 variables to add.
We have seen the documentation with the function add row but do not know how to apply it because we can’t create an app variable with the type Datarow and do not know how to convert an array to Datarow. Apps - Custom VB functions (uipath.com)
Yes, thank you! I am that far but now I do not now how to add the variables to the table.
My intuition was to use the set value formula: Dt = dt.AddRow(row)
Dt = dt.AddRow({“1”,“2”}) but that did not work.
I also tried:
Build dt2 with values “1”,“2”
Dt = dt1.AddRow({dt2rows(1)}) I did not get an error but the data was not transferred to the datatable.
Therefore, I really don’t know how to set the formula in the button. Do you have an idea?
Hi… I am not sure about your requirement but if you want to keep the data in the table one way is to have a process running which takes text values and table datasource as input and return the table data as output which will include the values added.
Thank you! But what we are looking for is the same as @Parth_Doshi described.
We would like to add more than one data row.
First, we build a datatable as you did in the workflow.
Second, the user enters the variables in the textboxes.
Third, the user adds a data containing the variables row to the existing datatable.
In a next step the user can repeat the steps 2 and 3 and input different data in the textboxes and add those as a data row to the datatable.
Using .addrow the error is always that .addrow is not a datarow.