cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Andrew260z1
Helper II
Helper II

Checking for the existence of an attachment with a specific name

I've got a requirement to find all list (SharePoint online) items in a list that might be up around 1000 items and changes daily. To find items that match a couple of conditions (easily done with an get items and condition statement) - then see if those list items are missing an attachment that starts with "SH" for example "SH123423.jpg" should be attached. I guess I need to loop through get the attachment display name(s)? as these things have generally more than 1 attachment ?

 

I then need to store the item number / SH number in a list and email that as a summary to the team, what would be the best way to approach that? 

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
UdayAdhikari
Continued Contributor
Continued Contributor

Hi @Andrew260z1 - as you explained, you need to get items first, loop through the items and for each item loop through the attachments object and check to see if file name starts with some character set, in your case "SH" and build your list with exception items to send notification emails.

 

Here is a shell of what you need which I just tested also. Hope this helps, keep us posted. 

 

PA-GetItemsWithAttachmentsNCheckNames.png

 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Thanks

View solution in original post

2 REPLIES 2
UdayAdhikari
Continued Contributor
Continued Contributor

Hi @Andrew260z1 - as you explained, you need to get items first, loop through the items and for each item loop through the attachments object and check to see if file name starts with some character set, in your case "SH" and build your list with exception items to send notification emails.

 

Here is a shell of what you need which I just tested also. Hope this helps, keep us posted. 

 

PA-GetItemsWithAttachmentsNCheckNames.png

 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Thanks

Thank you very much for the assistance it helped me in the right direction. I've got it working so it tells me that it is missing and also a separate one that tells me when the file name is wrong. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (4,205)