I try to find for a column, using API how to:
-
check if the column is hidden
-
change it to hidden or the opposite
I try to find for a column, using API how to:
check if the column is hidden
change it to hidden or the opposite
Hey, Im not an expert in this short answer: there isn’t a column.is_hidden field in the monday.com API. “Hidden” is a per-view setting (e.g., the Table view), so you read and update the view’s settings_str JSON.
How to check if a column is hidden
query ($boardId: [Int]) {
boards(ids: $boardId) {
id
views {
id
name
type # look for type: “table”
settings_str
}
}
}
hidden_columns: an array of column IDs to hide
columns_visibility: an object map of columnId → true/false
columns[columnId].hidden: true/false
Example check (pseudocode):
const s = JSON.parse(settings_str || “{}”);
const isHidden =
(Array.isArray(s.hidden_columns) && s.hidden_columns.includes(columnId)) ||
(s.columns_visibility && s.columns_visibility[columnId] === false) ||
(s.columns && s.columns[columnId]?.hidden === true);
How to hide/unhide a column
Read the current settings_str (as above) and parse it.
Modify only the relevant visibility field, keeping all other settings intact. For example:
To hide: add the columnId to hidden_columns (or set columns_visibility[columnId] = false).
To unhide: remove the columnId from hidden_columns (or set columns_visibility[columnId] = true).
mutation ($boardId: Int!, $viewId: Int!, $settings_str: String!) {
update_board_view(
board_id: $boardId,
view_id: $viewId,
view_data: { settings_str: $settings_str }
) {
id
settings_str
}
}
Notes and tips
Hiding is per view. If the board has multiple views, you must update the specific view where you want the column hidden/unhidden (commonly the view with type “table” and name like “Main Table”).
Always fetch and merge the existing settings_str to avoid overwriting other users’ settings (column order, widths, filters, etc.).
Some columns may be required/behave specially in certain views.
The exact shape of settings_str is not formally documented and can vary; inspect your current settings_str to see which visibility field your account uses.