cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Banana-Man
New Member

Exclude some file types or file sizes when copying email attachments to OneDrive

Hi, I am using a flow which copies attachments from incoming emails into a OneDrive Folder. But, I need to exclude some file types or file sizes from the flow. For example, some incoming emails have embedded images in the signature (.png graphics files for phone or address) which I do not want to copy.

 

I am new to Power Automate, so would appreciate some advice.

 

Derek

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User II
Super User II

Hi @Banana-Man,

 

This would be possible via a trigger condition expression. Below is an example.

 

I am using the endswith function together with the file name property of the trigger action. I am using a not function to exclude it in this expression.

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#e...

 

 

 

@not(endsWith(triggerOutputs()?['body/attachments']?[0]?['name'], '.png'))

 

 

You can add that expression via the settings of the trigger action in your flow.

 

 notanpngfilename.png

 

For file size you can use the size column of the triggerOutputs btw. Below is an expression for a size which is less than 1024 bytes.

@less(triggerOutputs()?['body/attachments']?[0]?['size'], 1024)

 

View solution in original post

2 REPLIES 2
Expiscornovus
Super User II
Super User II

Hi @Banana-Man,

 

This would be possible via a trigger condition expression. Below is an example.

 

I am using the endswith function together with the file name property of the trigger action. I am using a not function to exclude it in this expression.

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#e...

 

 

 

@not(endsWith(triggerOutputs()?['body/attachments']?[0]?['name'], '.png'))

 

 

You can add that expression via the settings of the trigger action in your flow.

 

 notanpngfilename.png

 

For file size you can use the size column of the triggerOutputs btw. Below is an expression for a size which is less than 1024 bytes.

@less(triggerOutputs()?['body/attachments']?[0]?['size'], 1024)

 

View solution in original post

@Expiscornovus  Thank you. I will give that a go.

 

Many thanks.

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (30,906)