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
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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,643)