Assign: The given path's format is not supported

Hello team,

I was creating workflow to find name of latest downloaded PDF file from download folder for that I have used two time Assign Activities

  1. Folderpath variable type string which is my Download folder path


  1. Filename Variable of type IENumerable which contains

“string.Join(”“,Directory.GetFiles(Folderpath,”*.pdf”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1))”

but i am getting error at this point saying that Assign: The given path’s format is not supported.

Can you please help to get resolve this


To get the recent created file we can use this part of your expression itself
And we don’t need join method here as we are anyhow taking only the first value out of ienumerable

Just use like this and give a try

Stroutput = Directory.GetFiles(Folderpath,”*.pdf”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).ToList(0)

Where stroutput will hold the filepath as a string

And if still error occurs as the error states clearly that there is an issue in folder path

Can you check once the folder path used
It should not have any file extension at the end like .pdf or.xlsx
It should just end with the last folder name where that file is placed

Pls check that once

Cheers @THE_NOOB_21


Have view on this


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