Compare Attachment Template with actual attachment

sandeep039_as
Tera Contributor

Hi Team,

 

We have a catalog form on which we are using a hyperlink to allow users to download an excel template.

 

Once downloaded the user is expected to fill the template and re attach.

 

Now the requirement is we would like to restrict user from attaching a different excel sheet apart from the one downloaded from the request form.

 

Request you to kindly suggest how I can proceed forward in this regard.

4 REPLIES 4

Maik Skoddow
Tera Patron
Tera Patron

Hi @sandeep039_as 

how do you want to find out that two different Excel files, one of which has been changed, are the "same" at the end? This question is not related to ServiceNow and to be honest I have no answer for it. However, if you find criteria which is unique enough to identify two different Excel files the same, then we can talk about a technical solution.

Maik

sandeep039_as
Tera Contributor

Hi @Maik Skoddow  In this case I would like to compare if the column name are the same in both the template and the attached excel file.

 

Based on that i would like to throw an error for the same

Hi @sandeep039_as 

basically that could be achieved by leveraging the GlideExcelParser API, but I cannot recommend this. All attachments reside in the same table sys_attachment. Whatever functionality you build, it will have an impact on all attachments you are uploading. The slightest error in your code could corrupt any uploaded file. And on the other hand I don't see that the benefits justify the expense.

Maik

sandeep039_as
Tera Contributor

Hi @Maik Skoddow Thanks you for sharing your thoughts.