Select file activity shows error

The attached process used to run just fine. I use it to select from a dropdown list and clicking some buttons in a webpage. I added a select file activity and read from csv activity. Then the process started showing error of the screenshot just at the first step. What can be the possible solution?

Main.xaml (18.7 KB)
Error

"22.4.0+Branch.master.Sha.0d4d7d3b0782bfa991b5e27402aa6a5cc826af0f

Source: Main Workflow

Message: Value cannot be null.
Parameter name: source

Exception Type: System.ArgumentNullException

RemoteException wrapping System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Data.DataTableExtensions.AsEnumerable(DataTable source)
at lambda_method(Closure , ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity) at System.Activities.Variable1.PopulateDefault(ActivityExecutor executor, ActivityInstance parentInstance, Location location)
at System.Activities.ActivityInstance.ResolveVariable(Variable variable, ActivityExecutor executor)
at System.Activities.ActivityInstance.ResolveVariables(ActivityExecutor executor)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
"

because you assign
( From row in AllDistrict.AsEnumerable() Select Convert.Tostring(row(“District”)) ).ToList()
to default value of AllDistrict, which will fail because allDistrict is null until the read CSV activity

try delete the default value of DistrictList and only assign it after read CSV

1 Like

Thank you for your response. Error resolved now.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.