Action center - Read the values from datatable and process each values using action center task

Description

I want to read the values from datatable and process each values using action center task but I’m getting the below error.

Kindly suggest any solutions

System.Exception: Type ‘System.Data.DataRow’ cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required. —> System.Runtime.Serialization.InvalidDataContractException: Type ‘System.Data.DataRow’ cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.

Link

Date

2024-07-24

Related UiPath products

Action Center

Hi @AnishKumar ,

To resolve this, you need to convert the DataRow to a serializable format (e.g., a dictionary) before sending it to the Action Center. Here’s how you can do it:

  1. Convert DataRow to Dictionary:
  • Before creating the task in Action Center, convert each DataRow to a dictionary or another serializable object.
  1. Create Task in Action Center with Serializable Object:
  • Pass the serializable object (dictionary) to the Create Form Task activity.

Regards
Sandy