Has anyone used the state field on Attachments to limit Access to the attachment?

Stacy1
Mega Guru

I can't find anything in documentation showing what the different states on the attachment table are for.

We want to limit show can see particular attachments and I am hoping to use the state field to determine that.

Didn't know if anyone knows how the states work?

Thanks,

Stacy

1 ACCEPTED SOLUTION

Stacy1
Mega Guru

So what I have learned is you can use the state 'not available' to prevent user's from downloading the file.

It will appear greyed out on the top attachment list and if they try to download it from the related list of attachments.  The file will simply say 'file not available'.

In case anyone was wondering how it worked.

Thanks,

Stacy

View solution in original post

8 REPLIES 8

Stacy1
Mega Guru

So what I have learned is you can use the state 'not available' to prevent user's from downloading the file.

It will appear greyed out on the top attachment list and if they try to download it from the related list of attachments.  The file will simply say 'file not available'.

In case anyone was wondering how it worked.

Thanks,

Stacy

Antonio39
Tera Contributor

Hi Stacy,

my issue is to let the agent decide when and which attachment to show and make it available for downloading.

I'm triyng to use state field in [sys_attachment], and when I put the state "Not Available" it returns me an errorMessage "Your file <file_name> failed the security scan. Your system is still safe - we quarantined the file and let your admin know. You can contact your admin for more info."

 

Do you think is there a way to achieve my requirement with state field?

 

tks in advance

Hi Antonio,

What I have learned is once it is in a 'not available' state it informs the user there is a security issue, both in the platform and the portal.  The attachment still shows but is greyed out and when clicked on downloads as sys_attachment and when opened says 'file not available'.

I also learned no one can change that state when it is not available.  So I had to create a new write ACL for admin with a condition of state= not available.

I am not sure where the message comes from, I haven't gotten that far.  I will update this post if I am asked to change that message and let you know where I find it.

I hope this helps a little.

Thanks,

Stacy

Came across this when searching for use of the state field.

The state field is related to antivirus and documented here: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0785328

In case this is still relevant...