Skip to main content

Hi Experts,

 

While working on a simple form with attachments, I faced an issue while uploading the file whereas there is already a file with the same name in the list.

 

Is there a quick way to provide a validation so that form can not be submitted before the file name is changed and uploaded.

 

Regards

Gaurav Mehta

Guarav


 


The only way you will ikely be able to perform a validation is to get a list of the documents in the library. From there, on attempted submission, you should be able to filter the list to check to see if there is a document with the same name. If the filter doesn't return any values, you proceed. Otherwise you toss an error message saying that a file with the same name already exists.


 


Ian


Thanks K2Lan for your response.

 

If you can explain me some steps or form rules to tackle that will be great, Apologies as I am very new to this.

 

Also, I am kust referring to the List item not library.


Hello, to add on to the previous response, maybe you can use a SmartObject to check whether a file of the same name has already been uploaded on the list. If you create an application for a SP2013 list with attachments, it should create a separate smartobject for the attachments. You can use this smartobject and run the Get Documents event to see if it returns anything if you use the file name as one of the filters. 


Reply