web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

ERROR READ CSV

(0) ShareShare
ReportReport
Posted on by 296

Hello Community,

 

When I run a flow in Power Automate Cloud with PAD it throws me the following error

 

Problem executing "ReadCSVWithCustomSeparator" action. Import failed. Failed to parse.

Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Import failed. Failed to parse. ---> System.IO.FileNotFoundException: Could not find file 'C:\.csv'.
at Microsoft.VisualBasic.FileIO.TextFieldParser.ValidatePath(String path)
at Microsoft.VisualBasic.FileIO.TextFieldParser.InitializeFromPath(String path, Encoding defaultEncoding, Boolean detectEncoding)
at Microsoft.Flow.RPA.Desktop.Modules.File.Actions.ReadFromCSVFileAction.Execute(ActionContext context)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.File.Actions.ReadFromCSVFileAction.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

 

My flow in the cloud with Unattended,

fgonzalez515_0-1666402465730.png

 

My flow in PAD run good,

fgonzalez515_1-1666402962946.png

 

How can I solve that?

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    @fgonzalez515 

    Clearly the filename is not getting properly populated.

     

    The error says..

    System.IO.FileNotFoundException: Could not find file 'C:\.csv'.

     

    So please double check.

    Add a Display Message box to check the output.

     

    Filenamenoextension is inside the loop, is it accessible outside the loop?

  • Jamar_Forsythe Profile Picture
    Microsoft Employee on at

    So that notation should work, I believe the reason is because the %FileCSV% might have been empty at the time it ran. This will cause the Loop not to run at all so none of those variables get populated. You can test this by maybe using a Set Variable action just before the Read From CSV action, set the new variable value to %Directory.FullName%\%FileNameNoExtension%.csv and save it to a location outside the flow that way you can review it later.

    You may also notice that you are using a For Each Loop and setting the values in Get Path Part, is this intended? You will always only end up with the last file only in that list before the Read From CSV action happens. If you want to reference the last File in the Files list, there are a few options:

    In the Get Files in Folder action, click the Advanced section and you can sort by any property available, like the date created and select in Descending order, this will put the most recently created file at the top of the list, then you can reference %Files[0]% as that will always be the first file in the list.

    Jamar_Forsythe_1-1666407818613.png


    You can possibly save some steps as well, %Files% is a List of Files Variable but %Files[0]% is a File variable, which means you could use just the Get Files in Folder then use something like %Files[0].Directory%\%Files[0].NameWithoutExtension%.csv. That example is a little redundant but I assume you are just testing things.

     

    This seems like an attempt to convert a CSV to an Excel Spreadsheet. If you CSV uses a default delimiter, then you could simply open %File[0]% in the Launch Excel action as CSV is a supported file type, then Save it as *.xlsx with the Close Excel action. Like this:

    Jamar_Forsythe_0-1666407599075.png

    Hope this helps, here are some recommendations for more variable manipulation options.
    Variable manipulation and the % notation - Power Automate | Microsoft Learn
    Variable data types - Power Automate | Microsoft Learn
    Datatype properties - Power Automate | Microsoft Learn
    Manage variables and the variables pane - Power Automate | Microsoft Learn

     

  • fgonzalez515 Profile Picture
    296 on at

    Hi @VJR 

     

    Testing the message, I get the expected result.

    20221022_001019.jpg

     

    With respect to getting "Filenanoextension" out of the loop, I did it like this since "Get files from a folder" throws me as a list of files and to get the path of the file outside the loop I will not be able to get it since the previous option is a list of file, since I downloaded that file from a web page.

     

    How can I solve that?

  • Jamar_Forsythe Profile Picture
    Microsoft Employee on at

    Its likely that there was no file present during that run, you can check that flow run, and see the input and output of that action at the time in the Cloud Portal of the Desktop Flow run.

  • VJR Profile Picture
    7,635 on at

    In the screenshot that you marked in red - Read from CSV is outside the loop

    That is what I am referring to and responded to your reply.

    That is where you need to put your display message and therefore asked Filenamenoextension is inside the loop, is it accessible outside the loop?

  • fgonzalez515 Profile Picture
    296 on at

    Hi @Jamar_Forsythe 

     

    I couldn't open direct CSV file in "Launch Excel".

    20221022_005235.jpg

  • fgonzalez515 Profile Picture
    296 on at

    @VJR 

     

    Attached screenshot of the message output. It returns the file path well and if it exists.

    20221022_010605.jpg

    Regarding the Loop query, I have no problem removing "Get File Path", but will it change anything? and how can i do it? since before I have a File List and if I use [#] any number in PAD it will throw me fine, but in the Cloud it will throw me an error.

  • VJR Profile Picture
    7,635 on at

    In the first screenshot you had the extension but no filename.

    In this screenshot only filename but no extension.

  • fgonzalez515 Profile Picture
    296 on at

    @VJR 

     

    I tried with other options and now the complete path of the file appears, but it says the error that it does not find the file in the indicated path.
    When I do the test in PAD everything works fine.

     

    Problem executing "ReadCSVWithCustomSeparator" action. Import failed. Failed to parse.

    Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Import failed. Failed to parse. ---> System.IO.FileNotFoundException: Could not find file 'C:\Users\fdogvg\Downloads\RCV_COMPRA_REGISTRO_77578630-2_202210.csv'.
    at Microsoft.VisualBasic.FileIO.TextFieldParser.ValidatePath(String path)
    at Microsoft.VisualBasic.FileIO.TextFieldParser.InitializeFromPath(String path, Encoding defaultEncoding, Boolean detectEncoding)
    at Microsoft.Flow.RPA.Desktop.Modules.File.Actions.ReadFromCSVFileAction.Execute(ActionContext context)
    --- End of inner exception stack trace ---
    at Microsoft.Flow.RPA.Desktop.Modules.File.Actions.ReadFromCSVFileAction.Execute(ActionContext context)
    at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

     

     

  • VJR Profile Picture
    7,635 on at

    Visit this path and check whether a file with this exact name exists.

    Path: C:\Users\fdogvg\Downloads\

    File: RCV_COMPRA_REGISTRO_77578630-2_202210.csv

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard