I have a For Each File In Folder activity, but I keep getting an error:
Error BC30311 Value of type ‘FileInfo’ cannot be converted to ‘String’
I just want to rename a file (excel) in a folder, but the difficulty is that the file (downloaded) has every download a new name… See screenshot. Thanks in advance!
Hello @Brooss
Use Filter By Properties–> Mention the File Extension with Asterisks like *xlsx. It will get only Excel files with specific Extensions.
Use Currentfile.ToString or CurrentFile.FullName to get the Full path of the file in a loop
The error `Error BC30311 Value of type ‘FileInfo’ cannot be converted to ‘String’” is caused by the fact that the For Each File In Folder activity returns an array of FileInfo objects, which is a different type than a string. To fix this error, you need to convert the FileInfo object to a string before you use it in the Rename File activity.
As Peter mentioned set the FilePath property to the following expression:
CurrentFile.FullName
This expression will get the full path of the current file in the loop.