cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Check if sharepoint file exists in sharepoint folder

I am trying to get the attachments of some emails and check if that attachment already exists in SharePoint. However, since the flow may have already run over some attachments that have already been received, they may or may not already be in SharePoint, so I first have to check SharePoint if the attachment exists and if they don't, create the file using the email attachment content.

 

So what I have so far is replicating a process that was described Here. The problem that quickly arises is that under "Get file content using path" action, the File Path input box(circled below) won't let me append a file path that isn't currently already in a document folder.

PowerAutomate Question.PNG

 

Not sure if this is still a valid way to accomplish it or if there's another way. I have checked all over the place and still haven't been able to find a solution. If there's anybody that can help it would be greatly appreciated!!

3 ACCEPTED SOLUTIONS

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @Anonymous ,

 

You shouldn't use the solution from the provided list since you want to check if the email attachments exists in the sharepoint folder.

I would suggest that you could check if the email attachments exist in the sharepoint folder by checking if the attachment name exist in the sharepoint libaray, the screenshot of the flow should as below:

1.png

The Length expression in the Condition as below:

length(body('Filter_array'))

 

If the attachment exists in the library, send an email, if not, save the attachment in the library.

 

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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

Update your flow to filter directly from Get Files (Properties Only), then check if you have any values returned.

FileNameWithExtension.png

In Get Files click on show advanced options and add your query in "Filter Query"

 

View solution in original post

Anonymous
Not applicable

I figured out a solution as seen in the screenshot! I just limited the search to a certain folder within SharePointPowerAutomate Solution3.PNG

 

Thank you everybody for your help!

View solution in original post

7 REPLIES 7
efialttes
Super User III
Super User III

Hi
What's your purpose when adding "Get file content using path" to your flow, and what's your target file? Is it the attachment you are about to upload in 'Create file'?
Thanx!


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



v-alzhan-msft
Community Support
Community Support

Hi @Anonymous ,

 

You shouldn't use the solution from the provided list since you want to check if the email attachments exists in the sharepoint folder.

I would suggest that you could check if the email attachments exist in the sharepoint folder by checking if the attachment name exist in the sharepoint libaray, the screenshot of the flow should as below:

1.png

The Length expression in the Condition as below:

length(body('Filter_array'))

 

If the attachment exists in the library, send an email, if not, save the attachment in the library.

 

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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

Anonymous
Not applicable

I am not sure? I saw it as a recent solution but all I am trying to do is check if the attachments name of the email is already in SharePoint?

Anonymous
Not applicable

Hi Alice!

 

Unfortunately, I tried what you had recommended and it is still uploading over what is already in there:( The help is greatly appreciated but as you may notice it has been quite frustrating

PowerAutomate Question3.PNG

 

Update your flow to filter directly from Get Files (Properties Only), then check if you have any values returned.

FileNameWithExtension.png

In Get Files click on show advanced options and add your query in "Filter Query"

 

View solution in original post

Hi @Anonymous ,

 

I suggest that you could share the screenshot of the flow run history and more details since your flow is correct and the flow would check if the attachment is exists in the library Documents.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

I figured out a solution as seen in the screenshot! I just limited the search to a certain folder within SharePointPowerAutomate Solution3.PNG

 

Thank you everybody for your help!

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

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

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (37,567)