How to convert system objects into readable Strings

Hi,
Can anyone help, i’m trying to output values to my datatable but theyre being shown as ‘System.Collections.Generic.IEnumerable`1[System.Object]’ in the datatable

Scenario
I’m trying to read 2 columns from an excel file (columns A & AW) and store the values in an into column 1 and column 2 of my datatable

I can read the columns from excel spreadsheet and successfully store the values into column1 & column2 objects

Column 1 imports fine into the datatable via ‘Add Datarow’ activity inside a ‘For each’ loop and shows the correct values that were gathered from the spreadsheet

The values shown in column 2 however are shown as ‘System.Collections.Generic.IEnumerable`1[System.Object]’ and i’m not sure how to convert that value into a readable value

For column 2 i used an ‘Update row item’ activity inside a ‘For each row in data table’

Heres my project if anyone wants to look

importColumnsFromExcelToDatatable.xaml (14.3 KB)

Any ideas what i’m doing wrong?

HI @sam.greenwood

Try item.ToString in the add datarow

Regards
Sudharsan

Hello @sam.greenwood

If you need those two column you can also try like this

  • Excel application scope
    • Read range
  • Use filter datatable

  • Write your datatable in the destination you want

Attaching the updated xaml
importColumnsFromExcelToDatatable.xaml (27.4 KB)

Hope this helps

Regards
Sudharsan

1 Like

Hi
The Add datarow part is working fine, the value of ‘{item}’ is already being stored in the datatable as a readable string

Its the Update row item part thats not working properly, and if i add the .ToString to my value, ie
image

then the output from the dataTable into the csv table looks like this and column 2 is now being populated with ‘System.String’:
ie
image

This will filter you only those columna and the values related to it @sam.greenwood

Hi @sam.greenwood

Can you try with this modification

That worked perfectly…ive been stuck on that for 2 days
:slight_smile:

Thanks very much

1 Like

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