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

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
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

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

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (80,740)