Multiple Assign activity error

Hi Friends,

I am getting error on multiple assign activity. can you please help me

Multiple Assign: Can not assign ‘Directory.GetFiles(refineryFolder,”*”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1)’ to ‘listFiles’.


Which type is listFiles? If it’s List<String> , can you try to add “.ToList()” as the following?

Directory.GetFiles(refineryFolder,"*",SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1).ToList()

or If it’s String[], try ToArray().


I will try and tell you whether it is working or not.

Here it is string, so i am using ToArray(). and again i am getting error
can you please check once

Directory.GetFiles(refineryFolder,“*”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1).ToArray()

What is the datatype of ‘listFiles’?


Can you try First() instead of Take(1) as the following?

Directory.GetFiles(refineryFolder,"*",SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).First()


Here data type is IEnumberable.

If I use First() instead of Take(1).
Again i am getting error.

Directory.GetFiles(refineryFolder,“*”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).First().ToArray()

Check once from your end.

Directory.GetFiles(refineryFolder,““,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1).ToList()
”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1).ToArray()


If we use First(), ToArray or ToList is not needed as the following.

Directory.GetFiles(refineryFolder,“*”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).First()


Again i am getting errror

Directory.GetFiles(refineryFolder,“*”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).First()


Alright. Can you try to get information for exception as the following steps?

  1. Run Debug

  2. Workflow will stop at the activity.

  3. Open detail for $ExceptionDetails at Locals Panel as the following and share its content.


can you see this once



As $ExceptionDetails contains more detailed information, can you share it by the above steps?


Ok I will check Then

Could you share a screenshot of the variables panel where you have created the variable ‘listFiles’?

Ok i will share with you.

Hi Friends

This is the one more error for other work Flow. I am sharing the error

I have tried what you have posted. still i am facing the issue. Shall i share entire workflow to you then


As listFiles is IEnumerable<String>, your first expression seems no problem. Perhaps the error is caused by not variable type but any other matter.

It’s good if you can share your workflow as file. However, probably it’s difficult to run your workflow because there is no same folder or files in my environment.