Cannot Assign Valutes to String Array via Assign

Scenario: I am trying to input data onto String array but getting error

Steps to reproduce: using Flies_Ka_Naam(IntCounter) and assigning “PPPPPP”

Current Behavior: getting error

Expected Behavior:value should be in

Studio/Robot/Orchestrator Version:

Last stable behavior:
Last stable version:
OS Version: Windows 7
Others if Relevant: (workflow, logs, .net version, service pack, etc):

Getting the error

Main has thrown an exception

Source: Assign

Message: Object reference not set to an instance of an object. This error usually occurs when using a variable with no set value (not initialized).

Exception Type: NullReferenceException

System.NullReferenceException: Object reference not set to an instance of an object.
at System.Activities.ExpressionUtilities.ArrayLocationFactory1.ArrayLocation.set_Value(T value) at System.Activities.Location1.ReferenceLocation.set_Value(T value)
at System.Activities.Location`1.set_ValueCore(Object value)
at System.Activities.ActivityContext.SetValueCore[T](LocationReference locationReference, T value)
at System.Activities.ActivityContext.SetValue[T](LocationReference locationReference, T value)
at System.Activities.Argument.Set(ActivityContext context, Object value)
at System.Activities.Statements.Assign.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Hi,
Looks like arryVariable assigned null value. Make sure variable contains some value.
Whats the source of file(excel…ect)

Could you please attach workflow.

image

Simplest Example where I am getting this error

Thank you very much for helping me out here

I appreciate your help in this regard

The error seems to be there with everything I try

this is also a string array

image

can you able to attach workflow?

Hey @B_R_Pawan_Kumar

May i know how you are initializing an array? are you?? if not then initialize it first.

Tip- Instead of array you should use List :slight_smile:

Regards…!!
Aksh

Please find attached the workflow

This seems to be the solution to my concern

Am I initializing the array ?? I do not think so … how do I do that ?

I request you to please guide me on how to Initialize an array of Strings

That should help me as I am not aware of how to create or work with lists

i do apologize for my ignorance

Hey @B_R_Pawan_Kumar

As i said you are not initializing an array here.

first do it like this in an assign activity.

String Mast_Maza = New String(3){}; //3 is size of an array here.

Then rest your workflow steps and it will work for you. :slight_smile: better to use List

Regards…!!
Aksh

2 Likes

Akash Yadav Ji

Thank you very much … you made my robo work and get me the results I want

Thanks a ton

image

2 Likes