Fetch the specs of columns in a target Grist document table

listcolumns(api, table_id, hidden = FALSE)

Arguments

api

A 'gristapi::grist_api'-object

table_id

Normalized table name (see id in listtables method). First character upper. OBLIGATORY

hidden

Set to TRUE to include the hidden columns. Default FALSE

Value

A tibble::tibble() object.

See also

Examples

# Working only if Env Var "GRIST_KEY" and "GRIST_DOC_TEST" are defined
# see the structure of a given table
table_name <- paste0("Mtcars_", get_os())
api <- grist_api$new(
  server = 'https://grist.numerique.gouv.fr',
  api_key = Sys.getenv("GRIST_KEY"),
  doc_id = Sys.getenv("GRIST_DOC_TEST")
)
listcolumns(api, table_id = table_name)
#> # A tibble: 12 × 18
#>    id    colRef parentId parentPos type    widgetOptions isFormula formula label
#>    <chr>  <int>    <int>     <int> <chr>   <chr>         <lgl>     <chr>   <chr>
#>  1 names   2979      273      2979 Text    ""            FALSE     ""      names
#>  2 mpg     2980      273      2980 Numeric ""            FALSE     ""      mpg  
#>  3 cyl     2981      273      2981 Numeric ""            FALSE     ""      cyl  
#>  4 disp    2982      273      2982 Numeric ""            FALSE     ""      disp 
#>  5 hp      2983      273      2983 Numeric ""            FALSE     ""      hp   
#>  6 drat    2984      273      2984 Numeric ""            FALSE     ""      drat 
#>  7 wt      2985      273      2985 Numeric ""            FALSE     ""      wt   
#>  8 qsec    2986      273      2986 Numeric ""            FALSE     ""      qsec 
#>  9 vs      2987      273      2987 Numeric ""            FALSE     ""      vs   
#> 10 am      2988      273      2988 Numeric ""            FALSE     ""      am   
#> 11 gear    2989      273      2989 Numeric ""            FALSE     ""      gear 
#> 12 carb    2990      273      2990 Numeric ""            FALSE     ""      carb 
#> # ℹ 9 more variables: description <chr>, untieColIdFromLabel <lgl>,
#> #   summarySourceCol <int>, displayCol <int>, visibleCol <int>, rules <lgl>,
#> #   reverseCol <int>, recalcWhen <int>, recalcDeps <lgl>