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’.

Hi,

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().

Regards,

Ok
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()

Hi,
What is the datatype of ‘listFiles’?

Hi,

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

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

Regards,

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()
Directory.GetFiles(refineryFolder,"
",SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1).ToArray()

Hi,

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()

Regards,

Again i am getting errror

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

Hi,

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.

Regards,

can you see this once

image

Hi,

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

Regards,

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

Hi,

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.

Regards