cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Filter attachments by name

Hello guys, 

I just started using flow this and I'm impressed by how much it will make my life easier.

I've tried to automate attachment fetching, which seems to works fine but having multi attachments in the same email caused a lot of troubles. 

I want to know how to filter the attachment and select the right one before creating a file in sharepoint.

many thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Filter attachments by name

Hi @Ammar,

 

Then you only need to determine if the Attachment Name contains a specific string.

Image reference:

37.PNG

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

7 REPLIES 7
Highlighted
Super User III
Super User III

Re: Filter attachments by name

@Ammar:

 

You can use an condition and evaluate the attachment file names in a loop using string expressions.

 

Can you give me an example of how you want to filter the files?

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Highlighted
New Member

Re: Filter attachments by name

@ScottShearer Many thanks Scott, 

I was hoping to do something like regex but not sure how to implement this in flow, currently, I'm doing this in R and it looks like this

"^Daily.*"
Highlighted
Community Support
Community Support

Re: Filter attachments by name

Hi @Ammar,

 

Currently MS Flow does not support the use of regular expressions.

Could you provide specific filter condition?

You could filter the files by using the function provided in Expression.

Please provide more details and we would provide proper workaround for you.

 

Best Regards,

Barry

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.
Highlighted
New Member

Re: Filter attachments by name

Thank you @v-bacao-msft,

I hope to be able to filter any file containing a certain string, for example, the word "daily".

 

many thanks 

 

Highlighted
Community Support
Community Support

Re: Filter attachments by name

Hi @Ammar,

 

Then you only need to determine if the Attachment Name contains a specific string.

Image reference:

37.PNG

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
New Member

Re: Filter attachments by name

Many thanks @v-bacao-msft,

 

That worked! 

My mistake is locating the condition at the wrong level.

 

cheers

Ammar

 

Highlighted
Frequent Visitor

Re: Filter attachments by name

Hi, newbie here
Just wondering if this would work for a whole email received or filter each attachment.
I mean, if there are more than an attachment and condition will save or drop only ones that meets the criteria and does otherwise for the rest? 

Thanks,

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

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

Top Solution Authors
Top Kudoed Authors
Users online (7,731)