cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
wkshum99
Level: Powered On

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
Community Support Team
Community Support Team

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
wkshum99
Level: Powered On

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

 

Community Support Team
Community Support Team

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

wkshum99
Level: Powered On

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

Hi v-bacao-msft

 

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,234)