Creating a results excel for a UIPath process

Hello,

I’m trying to create a results file that will record if a row from my input file was completed and the actions taken through out the process. I’ve tried creating a Data table and using Add data row activity to record the information in the data table. Then write to an excel file but im getting errors for my Variables being generic value. which i assume cant be used in a data table. Anyone know a solution to this?

1 Like

Hello @Marc757

You can try transforming the data into string.

cheers!

So I would convert the Generic value variables to a string variable. What activity would I use to do that? The assign activity? Thank you for the quick help.

Yes @Marc757 the assign activity

I’m still getting the same error. After using the assign activity to convert the variable to a string variable. I use the add Data Row activity to move the string variable to the data table but i’m getting the “Value of type ‘String’ cannot be converted to System.Data.Datarow” error still.

can i have a view on your xaml if possible
Cheers @Marc757

If you are adding the CaseID to the first column in your datatable, you should enter it into the ArrayRow property instead of DataRow property and surround it with {curly braces}.

So it will look like ArrayRow: {CaseID}

If it is a different column, you can provide empty strings until you get to the correct column. For example if you want CaseID in the 3rd column and the first to columns to be blank, it would look like this. ArrayRow: {“”,“”,CaseID}

1 Like

Fine now worris buddy
The issue is very clear and precise
–First, CaseID is a generic variable but it is assigned to a Datarow property in Add Data Row Activity
–Next to pass the value to the datatable with add data row, where we have in individual values as string or generic and not as datarow then we can still pass those values to the datatable with add data row Activity under Arrayrow property between {}
Like this
{Variable1.ToString, Variable2.ToString,…}

Here i have mentioned as string, we need to mention the datatype as per the column type…each value will go to the corresponding column position I. E., Column jndex starting from 0
So it means the number of values must be equal to number of columns

Thats all buddy you are done
Kindly try this and let know whether this works or not
Cheers @Marc757

Hello,

That worked. Thank you for the help!

Fantastic buddy @Marc757
Kindly close this topic with right comment marked as solution that could help others as well
Cheers

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