Read Latest Downloaded Excel from Outlook

Hi All,
I want to read the latest downloaded excel file from outlook every time when my flow is run.
Using save attachment I am able to save to outlook attachment but unable to read and write into the latest one.

Hey @avinash.wankhede ,
You ca use below method to get the latest file

Directory.GetFiles("FolderPathWheretheAttahmentSaved","*.xlsx").OrderByDescending(Function(d) New FileInfo(d).CreationTime).Tolist(0)

Regards,

but in excel application scope, how i can read this excel file

first download the files using download attachment attachment activity
in excel application scope paste that above syntax where you configure file path

Directory.GetFiles(“FolderPathWheretheAttahmentSaved”,“*.xlsx”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Tolist(0).tostring

@avinash.wankhede
Use one Assign activity before excel scope:
Give like this:

StrFilePath = Directory.GetFiles("FolderPathWheretheAttahmentSaved","*.xlsx").OrderByDescending(Function(d) New FileInfo(d).CreationTime).Tolist(0)

And pass StrFilePath to excel scope to read the file

@avinash.wankhede ,
You can Assign it to a String Type Variable and then you can pass that String variable inside the Excel application Scope

Regards,

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