Hi,
I’m beginner for UI path and trying some UI automation.
I’m reading the values from excel and stored in DT1.
For Each value I’m extracting a table data and append the results in DT2.
For DT2 I need to add one more column and assign the default value as “input” variable.
Its running correctly for the first time and throwing error from the second time since the column name was already added to the DT2.
The bot go to if condition to check the Job Number column is available in datatable or not. If yes, it go to then block and don’t do anything, If no, it go to else block and add Job Number column in datatable by using add data column activity.
Can you try to put the following Assign activity just before ExtractTableData activity? Because it’s IN/OUT type argument and previous schema is kept unless it’s cleared. Or it might be good to change scope of the DataTable varable.
@mkankatala - Thanks for the solution. But if I put “Add data column” activity in if loop then the column will write only one value.
For each search I will be getting 4 to 5 rows of table data for all line items I need to update the “Job Number” for all rows and for the second table different job number to be updated.
Could you be elaborate whole process with some input files then only we will get understand and able to provide the solution, If possible share your workflow too.
@Yoichi
Thanks for the reply.
If I add the assign activity it will erase the extracted results of previous search.
It will write the values of last search.
But I need table values for all searches and need to write job number against each search results.
@mkankatala
Sorry for the confusion. Let me elaborate the process.
I have list of job numbers in excel and I’ll read them using read range and stored in DT1.
Then I’m using for each activity to input each job number in our ERP tool which will give me a table data (usually 4 to 5 rows) and stored the values in DT2, and it will repeat for all the job numbers.
At last, I’m writing the DT2 in excel using write range.
Here is my sample output which is working when I have one input. But when I have multiple job numbers it is not working.
ExtractDataTable.AsEnumerable.Where(Function(r) String.IsNullOrEmpty(r("Job Number").ToString)).ToList().ForEach(Sub(r)
r("Job Number")=strData
End Sub
)
To isolate cause, can you try to set Breakpoint at ExtractTableData, then debug run?
Workflow will stop there, then press F11 and check the datatable has expected data?
If it’s no problem, press F11 some times and check if column is added and input data is stored?
Next Press Continue button, then check the above for the 2nd iteration.