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.
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!
Solved! Go to Solution.
Hi @Julien2 ,
You could use below formula to achieve this:
If(IsBlank(Lookup(LibraryName,'File name with extension'=TextInput1.Text)),Set(FileLinkFromFlow, Powerapps.Run(TextInput2.Text & ".jpg", Dropdown1.Selected.Value, TakenPic).filelink)&&Reset(TextInput2)&&Navigate(ViewReport,None),Notify( "Duplicated file name", NotificationType.Error ))
Regards,
Mona
Hi @Julien2 ,
You could use below formula to achieve this:
If(IsBlank(Lookup(LibraryName,'File name with extension'=TextInput1.Text)),Set(FileLinkFromFlow, Powerapps.Run(TextInput2.Text & ".jpg", Dropdown1.Selected.Value, TakenPic).filelink)&&Reset(TextInput2)&&Navigate(ViewReport,None),Notify( "Duplicated file name", NotificationType.Error ))
Regards,
Mona
Hi @v-monli-msft ,
Thanks for replying. But i am stuck in the function with what i should replace instead of 'File name with extension',while it should be the text value of the user that he choose to name the file.
So it's not a specific name that i want to check for it. I want to check if the text value does not exist in the list it will save the image else it should notify the user to use another name.
I've also tried to check for a specific file i got error in the function:
The document library name is named: Expenses Bills Images
But i think that it's also not taking the name in the function.
So what i should use in the function instead of 'File name with extension' to get text value of the user that he used to name the file ?
Thank you!
Here's what I would do.
On savebutton.text:
If(TextInput2.Text &".jpg" exactin DataSource.ColumnName, "This filename is already in use", "Save File")
Then savebutton.OnSelect:
If(TextInput2.Text &".jpg" exactin DataSource.ColumnName, Notify("Cannot use duplicate filename", NotificationtypeError, Run save commands)
if the & "jpg" doesn't work, you may have to Concat(Textinput2.text, ".jpg")
Hi @cds ,
Thank you for replying!
So i have set Text function to the save button to the following function which works.
If(TextInput2.Text &".jpg" exactin 'Expenses Bills Images'.'{Name}' , "This filename is already in use", "Save to SharePoint")
But OnSelect i got some errors in the function because i got other conditions used,if you can guide me to complete this function which is the following:
If(TextInput2.Text &".jpg" exactin 'Expenses Bills Images'.'{Name}'),Set(FileLinkFromFlow, Powerapps.Run(TextInput2.Text & ".jpg", Dropdown1.Selected.Value, TakenPic).filelink)&&Reset(TextInput2)&&Navigate(ViewReport,None),Notify( "Duplicated file name", NotificationType.Error ))
I tried also If(Concat(Textinput2.text, ".jpg").. but didn't works.
you are saying if exactin, create anyway. put your command in the false position of the IF and notify in the true spot
I tried this one but i get error where i have marked the comma in RED any idea why?
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)
delete that ) before the ,
Hi @cds ,
Sorry for late reply.
I removed the ) before , it's showing red at the end of the function and the error is the following:
Any idea?
Thank you!
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
192 | |
67 | |
46 | |
41 | |
22 |
User | Count |
---|---|
252 | |
122 | |
84 | |
80 | |
71 |