cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected error can't convert system.object to a blue prism data type

GiriGurijala
Level 2

I intended to do the following

  1. Connect to Blue prism data base from process studio
  2. Execute certain query
  3. Retrieve the output as collection able to connect successfully to database but facing below error at 'get collection ' stage-- Internal: Unexpected error can't convert system.object to a blue prism data type.


------------------------------
Giri Gurijala
------------------------------
1 BEST ANSWER

Helpful Answers

smssubhani
Level 4

I fixed my case by removing typeof(object) from red line below and I am able to get the result into BP Collection.

my code e.g. 
foreach (var field in fields)
{
//if (!dataTable.Columns.Contains(field.Name) && !field.Name.StartsWith("@odata.etag"))
if (!dataTable.Columns.Contains(field.Name))
{
dataTable.Columns.Add(field.Name, typeof(object)); // Add column if it doesn't exist
}
}
break;

hope this will give you some idea.

View answer in original post

5 REPLIES 5

Michael_S
Community Team
Community Team

[Mod Note: Moved to Blue Prism RPA forum]



------------------------------
:blue_heart: Michael
(I'm part of the SS&C Blue Prism Community Team)
------------------------------

Hello,
 
 
The solution is very similar.
 
Regards,


------------------------------
Leonardo Soares
RPA Developer Tech Leader
Bridge Consulting
América/Brazil
------------------------------
Leonardo Soares RPA Developer América/Brazil

I'm getting "Page not found"

John__Carter
Staff
Staff

It's likely that there are data types from the DB that do not naturally match the BP datatypes, and some sort of manipulation is required. GUID is a typical example, it's everywhere in the DB and needs to be converted to make it output-able as the Text BP data type, e.g. CONVERT(NVARCHAR(36), ProcessID).

smssubhani
Level 4

I fixed my case by removing typeof(object) from red line below and I am able to get the result into BP Collection.

my code e.g. 
foreach (var field in fields)
{
//if (!dataTable.Columns.Contains(field.Name) && !field.Name.StartsWith("@odata.etag"))
if (!dataTable.Columns.Contains(field.Name))
{
dataTable.Columns.Add(field.Name, typeof(object)); // Add column if it doesn't exist
}
}
break;

hope this will give you some idea.