I need to calculate sha 256 on ritm

AkshataP30
Tera Contributor

I have a restriction on ritm attachment that not more than 256 mb its allowing to attach, we need to attach within 256mb, i have a requirement, once i submit ritm for particular category, i need to attach a file of 300mb that needs to calcuate sha 256 of a exe, msi files and store only hash value and file name instead of entire file on attachment table, how to achieve this? In portal we can have custom widget and calculate sha value of a file without storing same thing should apply on native ui ritm level once they attach a exe file

2 REPLIES 2

vaishali231
Kilo Sage

Hey @AkshataP30 
Instead of using the standard attachment control, implement a custom file selection component.

Flow:

  1. User selects an EXE or MSI file.
  2. The browser reads the file locally.
  3. A SHA-256 checksum is generated from the file contents.
  4. Store only:
    • File Name
    • File Size
    • SHA-256 Checksum
  5. Submit these values as catalog variables or save them to a custom table.
  6. Do not upload the actual file to ServiceNow.

Benefits

  1. No record created in the attachment table.
  2. Not affected by attachment size limits.
  3. Supports files larger than 256 MB.
  4. Reduces storage requirements.
  5. Retains only the metadata and checksum value required for validation.

Service Portal / Employee Center

This can be implemented through a custom widget that allows file selection, generates the checksum locally, and submits only the resulting values.

Native UI Catalog

For the Native UI, the standard attachment variable would need to be replaced with a custom UI Macro, UI Page, or custom catalog component that handles file selection and checksum generation without creating an attachment record.

***********************************************************************************************************************************

If this response helps, please mark it as Accept as Solution and Helpful.

Doing so helps others in the community and encourages me to keep contributing.

Regards

Vaishali Singh

Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb

 

Hey @AkshataP30 

 

Hope you are doing well.

Did my previous reply answer your question?

If it was helpful, please mark it as correct ✓ and close the thread . This will help other readers find the solution more easily.

 

Thankyou & Regards

Vaishali Singh

Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb