Index was outside the bounds of the array in Assign activity

Hi @askvajrang,

I am encountering an error with Assign activity below. Please help @parvathi_ayanala.

Hi @SyedFARHAN

I think you are trying to extract the Client ID, Client Name, Client Country if yes, check and follow the below steps from the thread.

Regards

@SyedFARHAN,

Welcome to the UiPath Community.

The cause of the issue that you are trying to access an element of array which is not available.

I can see you are splitting screen and retrieving the element from the result array.

Clearly it’s the issue of string you are splitting.

Thanks,
Ashok :slight_smile:

@ashokkarale is correct, this error is because you are asking for a value from the array (which is a split string in this case) with an index which doesnt exist in the array - i.e. is too high.

An easy way to test / see what your array looks like is to log the array(0), which will show the first part of the array and give you an indication of what the issue is. likely either not splitting it correctly, or you haven’t worked out the index correctly (remember index is position/count -1)

Hi @SyedFARHAN

Can you send us the code written on the RHS, most probably it’s an issue with the Index that you are giving in parenthesis something like in the first one it would be (1) and in the second one it should be (0).

Thanks

Happy Automation! :smiley:

@SyedFARHAN,

I know Regex approach to solve this problem would be tempting :money_mouth_face: but would advise to use split because the lesson you learnt is on string manipulation.

Get basics clear. Good luck🥇

Thanks,
Ashok :slightly_smiling_face: