Getting error in build data table and add data row

While adding each data row in studio im getting error when row has no value and mentioned down below error

Add Data Row: Input string was not in a correct format.Couldn’t store <> in July Column. Expected type is Single.

Hi @sathish_Kumar6

Make sure you give the correct column name as given in Build Data Table in Add data row activitiy as given in Build Data Table

Regards,

Hi @sathish_Kumar6

Check for empty values: Before adding the data row, verify if the value is empty using an If activity. You can use the String.IsNullOrEmpty method to check if the value is empty or null.

@sathish_Kumar6 Check if the row you’re adding has a value in it.
Also make sure the type of data is same as the type of the column.

@sathish_Kumar6

In add datarow activity:{Input.ToString,Input.ToString}

Check your add datarow whether the format is correct

Or check the inputs you are passing having null values,if the data you are passing having null values use String.IsNullOrEmpty

Or check the inputs have Special charactres included in the datarow even this also will raise error

@sathish_Kumar6

  1. Check if there are empty or null values in your data.
  2. Verify the data type of the “July” column in Excel file. It should be of a numeric data type like “Single,” “Double,” “Integer,” etc. Make sure that the data you are trying to add is of the same data type.
  3. You can use the Convert.ToSingle() method in UiPath to convert the data to the “Single” data type.
    row("July") = Convert.ToSingle(yourValue)

Even after doing that getting same error

no value so that is the issue

@sathish_Kumar6

Yes, you can either convert them to a default value (e.g., 0) or skip adding rows with empty values.

@sathish_Kumar6
Could you share the screenshot of the data table and add data row activity.
Regards,

@sathish_Kumar6

Can you please show how the add data row is used and what are the datatypes of each column in your dt

Cheers

okay thanks for the suggestion

1 Like

okay sure will share them



shared please check and let me know if additional details required

@sathish_Kumar6

After removing or replacing the null values did any error occur?

You can pass like this:
CurrentRow(“colName”).tostring

Hi @sathish_Kumar6
You can pass in this way

CurrentRow("column name").ToString

Regards

Thanks for the suggestion

yes i have passed that one now im getting error as Insert: Incorrect syntax near the keyword ‘from’.