cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Julien2
Super User
Super User

On save check for existing name in SharePoint document library

Hello everyone!

I have created a page that will be used to take pictures, to write the filename of the picture,and to choose the category of the picture and save the data to SharePoint library using flow.
I have a problem which consists of for example while user 1 saves an image under the name ”TESt” if someone else saves a different image under the same name the first image is replaced by the second person’s image.

I want to check for existing column Name in my document library before allowing the user to save the image, which consists of a notification that brings notice that an other file is named the same name already.

Capture.PNGCapture1.PNG

So what will be the function to check for the name column in SharePoint’s document library and send notification to the user ? any help would be appreciated.

I am using the following function OnSelect to start the flow on save.

Set(FileLinkFromFlow, Powerapps.Run(TextInput2.Text & ".jpg", Dropdown1.Selected.Value, TakenPic).filelink);Reset(TextInput2);Navigate(ViewReport,None)

Thank you!

12 REPLIES 12
cds
Impactful Individual
Impactful Individual

Highlight the error. Post that.

@cds 

The error showing at the end of the function but it's not even highlighted in the function:

If(TextInput2.Text & ".jpg" exactin 'Expenses Bills Images'.'{Name}',Notify( "Duplicated file name", NotificationType.Error ),Set(FileLinkFromFlow, Powerapps.Run(TextInput2.Text & ".jpg", Dropdown1.Selected.Value, TakenPic).filelink)&&Reset(TextInput2)&&Navigate(ViewReport,None)HERE AT THE END after ) there is red no idea why.

@Julien2 Hi, did you solve it? I have the same problem!

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

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

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,979)