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

View solution in original post

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,917)