1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【ServiceNow】attachmentタイプの変数で拡張子チェックを行う方法

Last updated at Posted at 2022-07-26

attachmentタイプの変数に添付できるファイルの拡張子を制限したい場合、
変数属性allowed_extensionsを使用することで実現できます。

実装方法

変数のVariable attributesにallowed_extensionsを入力します。
下図はxlsmの添付だけを許可するケースです。
image.png

動作確認

設定した変数に許可していない拡張子のファイルを添付しようとすると
添付できず、エラーメッセージが表示されます。
image.png

許可している拡張子のファイルを添付すると以下のように表示されます。
image.png

補足

カタログアイテム画面だけでなくAgent画面のリクエストアイテムフォームでも制御されます。
image.png

おわりに

クライアント処理でチェックを入れることも可能ですが、たった一行で実装できる便利な機能です。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?