cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

extract and rename Outlook attachment by looking up mappings from excel table

I want to write a flow to extract Outlook attachment, rename and saved in Drive.

 

The filename will be looked up from a excel table, eg.

 

old_filenamenew_filenamedrive_folder
Report_0064General.csv/Flow_process/folderA
Report_0066Chg.csv/Flow_process/folderA
Report_0065Ctnr.csv/Flow_process/folderB
Report_0069Chg-New.csv/Flow_process/folderB
Report_0068Ctnr-New.csv/Flow_process/folderB

 

https://drive.google.com/open?id=1IBnsG7UiFAXquu0Oly0yONdveDwjW-p9

So I created above filter array. Now I'm strugging on the syntax of the folder path and file name

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: extract and rename Outlook attachment by looking up mappings from excel table

Hi @wkshum99,

 

If all the fields in the default should have a value, you could determine whether the value of any field is empty. If it is empty, then the Create file 2 action is not executed.

You could modify Flow in two ways:

  1. Add additional judgment conditions in Filter array, use the empty() function to determine whether any one field value is empty, and filter all non-empty rows.
  2. Or add a Condition action above Create file 2 action to determine if it is a blank rows.

Image reference:

20.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Regular Visitor

Re: extract and rename Outlook attachment by looking up mappings from excel table

I think I know the problem.

 

So to recap, I use an excel file to store the attachment-newfilename pairs and extract the Outlook attachments and save to Drive as newfilename.

 

Capture.PNG

I use the expression 

  • item()['drive_folder'] under the "Folder Path" and
  • item()['new_filename'] under "File Name"

It always returned error even though the file did actually created.

Capture1.PNGLater I found its the Filter Array got problem. It keeps the blank rows in the output sets, so my previous for each looping through these empty rows and caused problems. How can I ignore those empty rows? I always have an impressions that Filter Array should only return the matched row and matched row only.

Capture2.PNG

 

Highlighted
Community Support
Community Support

Re: extract and rename Outlook attachment by looking up mappings from excel table

Hi @wkshum99,

 

If all the fields in the default should have a value, you could determine whether the value of any field is empty. If it is empty, then the Create file 2 action is not executed.

You could modify Flow in two ways:

  1. Add additional judgment conditions in Filter array, use the empty() function to determine whether any one field value is empty, and filter all non-empty rows.
  2. Or add a Condition action above Create file 2 action to determine if it is a blank rows.

Image reference:

20.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Regular Visitor

Re: extract and rename Outlook attachment by looking up mappings from excel table

Hi v-bacao-msft

 

 

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,368)