LoginSignup
3
1

More than 1 year has passed since last update.

kintone カスタマイズ レコード作成・編集時の添付数取得

Last updated at Posted at 2022-02-22

注意点

  • DOM操作のためkintone側のアップデートで方法が変わる可能性あり

準備

添付フィールドのClass名を取得(Chrome)

1 添付ファイルフィールドの上で右クリック
image.png
2 検証をクリック
image.png
3 "control-gaia control-file-field-gaia field-???????"を探す。
項目ごとの添付ファイル数取得にはこの「field-???????」のクラス名を利用する。
image.png

取得方法

classnameの部分に「.field-???????」を代入してください。
※クラス名なので頭に「.」を付けるのを忘れずに。

PC

PC
const className = ""//.field-???????
const field = document.querySelector(className);
const count = field.querySelectorAll(".plupload_file_name").length; //添付ファイル数

モバイル

モバイル
const className = ""//.field-???????
const field = document.querySelector(className);
const count = field.querySelectorAll(".forms-file-preview-caption-name-gaia").length; //添付ファイル数
3
1
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
3
1