error>> {
“message”: “This is System Exception Geting the Details from the QueueSystem.InvalidOperationException: Can not assign ‘in_TransactionItem.SpecificContent("First Name").ToString’ to ‘FirstName’.\r\n —> System.NullReferenceException: Object reference not set to an instance of an object.\r\n at Namespace_eb3a.Process_Expressions.Process_Expressions_TypedDataContext2_ForReadOnly.__Expr1Get()\r\n at Namespace_eb3a.Process_Expressions.Process_Expressions_TypedDataContext2_ForReadOnly.ValueType___Expr1Get()\r\n at Namespace_eb3a.Process_Expressions.InvokeExpression(Int32 expressionId, IList1 locations, ActivityContext activityContext)\r\n at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context)\r\n at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity)\r\n at System.Activities.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor)\r\n at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate)\r\n at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Int32 startIndex)\r\n at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)\r\n — End of inner exception stack trace —\r\n at System.Activities.Statements.Throw.Execute(CodeActivityContext context)\r\n at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)\r\n at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)”,
“level”: “Error”,
“logType”: “User”,
“timeStamp”: “20:38:34”,
“fileName”: “Process”,
“jobId”: “18a925c8-67ac-4d72-9288-12fbe218ce0a”,
“robotName”: “mulani.mohasin123@gmail.com-attended”,
“machineId”: 5100623,
“userKey”: “be0cffbd-4f0f-427b-8989-bdb42f5b10bc”,
“processVersion”: “1.0.0”,
“organizationUnitId”: 6865198,
“businessOperationId”: “1699c4fa83074e1c97e6e95e3a506d08-04cded798724440f91c27d1a2367567e”
}
Do it in a normal assign and you’ll see a much clearer error message showing the issue. Multi assign is nice for housekeeping, but doesnt do the best job at showing the error as you need to look deeper into the errors inner exception if I recall.
Why are you doing this? There’s no reason to assign transaction values to local variables. It creates added complexity and overhead. You should just use the in_TransactionItem.SpecificContent values anywhere you need them.
Readability, UiPath UI boxes are small. It’s to know what variable is being used inside code, instead of “in_TransactionItem.Sp..” , you can actually see what variable you are using.
For example, here I can see that I’m using the specific content “Customer”, rather than having to open up the assign to see what I’m using.
I’d propose what I think is a better solution that follows some coding best practices.
Make a coded source file that contains all these properties, so in your case Customer and ‘doStuff’, and at the start of your process load all your specific content to that, I do it via a constructor that takes the queue item so its a simple one liner in the process.xaml
From there you can use it nicely, without a cluttered variables pane as you group them together, aswell as the added benefits of readability, strong data typing and making sure up front that all your values in the specific content are populated and validated.
All you have to do is edit the name of the activity with the Key you’re using. Notice that you can’t actually see in any of the Assigns what’s on the right side. So now when someone encounters the Customer or doStuff variable in the process, they have to go find where you assigned that value to figure out what it contains.
@postwick Its useful for strong data typing and making sure all the data is valid as you start. Better when you add it to a full class, but you are making an issue out of nothing here, there is nothing wrong with doing this.