I cant fix this issue with Add Data Row activity.Cant use variable inside Array Row.Someone please help!

Hi,

The following helps you.

Regards,

I tried with three variables but shows the same error

Hi,

Did you input as the following if your number of columns is 1.

new object[] {yourVariable}

Regards,

1 Like

Works like a charm:
image

So could it have to do with the datatypes you have in your array? (can you screenshot your variables as shown in my screenshot?)

But why mine is not working?Screenshot (4)

Hi,

Can you try to paste the following expression into the ArrayRow property?

new object[] {bitcoin_Price,lasthour_High,lasthour_Low}

If error occurs, please share its screenshot.

Regards,

1 Like

still shows an error

Hi
May be let’s do it other way

  1. Create a list variable named list_input in variable panel of type System.Collections.Generic.List(of String) with default value as New List(of String)

  2. Now use a ADD TO COLLECTIONS activity where in collections mention as List_input and in item mention the variable named bitcoin_Price.ToString

Use another activity with list variable name in collection but item as lasthour_High.ToString

And a final add to Collections with same collections variable and item as lasthour_Low.ToString

  1. Now use a ADD DATAROW activity Where in ARRAYROW property mention as list_input.ToArray() and in dt mention the DATATABLE name

Hope this would help you resolve this

Cheers @Althaf_nazeer_Nazeer

1 Like

Hi,

Thank you for sharing.
This error shows these variables is not defined. (So, error have been changed.)
Is there same place at your previous screenshot? Can you share variable panel?

Or

To isolate cause, for now, can you try the following expression?

new object[] {}

Regards,

1 Like

I fix this problem by myself. I was enabled c# language in the Uipath settings. That’s why i got this error.Just disabled that and now it is working…thanks all

regards

2 Likes

This way it worked for me:

new object {var1, var2, var3, … , varN}