I can't write my GenericValue variable to a DataTable

I am a complete rookie, just doing the UiPath Level 1 foundation training, Lesson 9. This involves creating the sum of 2 columns of excel data and then assigning that result to a variable and then writing that variable to a new spreadsheet.

I’ve got the values of the 2 columns by using ‘Get row item’ (which are stored as variable types of GenericValue) And I’ve assigned the sum of those values to a new variable (called ‘valueC’ – which is also of variable type GenericValue). I’ve put the set up in the image below.

But when I try to use a ‘Write range’ to write ‘valueC’ to the new spreadsheet, I get the following error message:

'Compiler error(s) encountered processing expression “valueC”. Value of type ‘UiPath.Core.GenericValue’ cannot be converted to ‘System.Data.DataTable’

Does anyone know what I’m doing wrong here? I’m pretty sure I’ve followed the exercise precisely. Though I have tried creating the exercise workflow again in case I did something wrong the first time.

Also I’ve searched for similar topics, but nothing seems to help, or solve the puzzle of why the basic foundation exercise isn’t working for me. I’ve also tried change the variable type of the variable I’m trying to write, but that doesn’t help either.

Any advice you have would be gratefully received! Thanks very much!

Akan

‘Write Range’ is used to insert the DataTable within the Excel sheet. I believe you are should be using ‘Write Cell’ activity. ‘Write Cell’ inserts your string data to a particular cell in the excel sheet.

Check this,

Thanks,
Rammohan B.

Hi Rammohan - that’s worked perfectly - thanks very much for you feedback, much appreciated!

Thanks

Akan

1 Like

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