Query the number of files attached to a particular column

Is there a way to query a particular column to see how many files are attached there?

Using Column Values V2, you can return the files array, which will return all of the files in the column. You then just need to use files.length or equivalent to get the count of files. But there are various structures of files for links, assets, or docs. Links are things like onedrive, google drive or dropbox, assets are actual files, and docs are monday docs. This way you can potentially filter them based on your needs (maybe you only want to get the count of assets, but not links or docs)

query {
  items(ids: "123123") {
    column_values(ids: "files") {
     ... on FileValue {
       files
     }
    }
  }
}
1 Like

Thank you @codyfrisch!

@lavanyadeepak - just so you’re aware, I moved the sub-category of your post so it gets more visibility in the questions queue :smiley:

Best,
Rachel

1 Like