How to resove error of : Assign : Index was outside the bounds of the array

Dear all,

I have a question that when I tried to assign DataRow value into variables (GenericValue),
I got below error message…

Assign : Index was outside the bounds of the array.

How can I fix this? sorry for vague question but with my capacity it is the best I could describe in detail…

3 Likes

@Kn.opp this error occurs due to more element in the specified array size

Hi Kn.opp,

to give a bit more detail this error occurs when you are trying to access an index outside of the current bounds of the array.

e.g. you have an array of 5 items. (array {1,2,3,4,5}) if you try to get the item from index 10 (array(10)) you will get this error as there is actually only 5 indexes (the max being 4 as arrays start at 0).

Could you give more info on how you are assigning your data row into variables and we may be able to get you a fix.

1 Like

Dear jakelewis18, indra

Thank you very much for your help here…!
I’ve tried assigin data row as attached… I hope this limited screenshot would be sufficient for your advise…

Thank you very much…

Screenshot1

Screenshot2

Screenshot3
uipath20171115-3

1 Like

@Kn.opp, There might be a chance of returning a empty array of datarow (arrDataRowOfCsv3) after filtering. U are accessing an empty array with some index greater than zero, it returns this error.

Solution : Check the array count before you access it through index !

Regards,
Dominic :slight_smile:

Dear 599712

Thank you very much, it was the case. I could resolve the select and assign issue.

But just wondering if I could ask other question…

When I tried to assng value, I got “Exception has been thrown by the target of an invocation” error as screen shot.
Just wondering how could I resolve this issue?

Screenshot1
uipath20171115-11

Screenshot1

Try :
dataRowForNewDt(“Column1”) = “CompanyinCSV”

Hi

i need to paste the values from the data table based on the condition that if the cell is empty i need to paste it.After pasting all the values it is throwing an exception (i.e) index out of range exception.As am new to uipath,how to check whether the values are there in the input data table.if the value is there in collection it should go and paste or else it should break.Help me out of this


Thanks,
Niranjanaa

Hi guys, I have an array of 100 items and when I try to assign item with index 2, I alsao get that error “Assign : Index was outside the bounds of the array.”. Can anyone explain this? Thanks

How did you solve this issue of Index out of bounds, i too have a similar case, while accessing the value at 0 index, getting out of bound error.

Hello, I’m having an issue with my array. Can anyone help?
Index was outside the bounds of the array.docx (62.9 KB)