Add Watchlist Column or Funnel Option
add_watchlist_columnFull Description
Add a column to a watchlist's table, or reconfigure one already there.
Every add reports one entry per column under added, each with a status saying what happened to it. Pass a custom column's reported name to set_watchlist_cell_values to fill in values — that name is always one this watchlist resolves, so use it as reported rather than the name you asked for: where the watchlist already had a column of that name, it comes back as Name (#7), which is the form every column tool accepts.
This is also how you edit an existing column's options or format. Pass the column's existing name and matching type, and it is edited in place rather than duplicated, reported as status: updated:
type='select'+options— adds those labels to the ones it already
offers (pass only the new ones). added_options lists the new labels and options the resulting full set.
type='number'+number_formatand/ordecimal_places— changes how its
values are displayed, e.g. currency to percentage.
type='date'+date_format— changes how its dates are displayed.
None of these touch stored values: added options leave existing ones (and their cells) alone, and a format change is display-only. Never delete and recreate a column to change its options or format — that wipes every value in it. A column's resulting settings come back on a create too, since unspecified ones take the type's defaults.
type has to match the existing column for the edit to land. If this watchlist has a select/number/date column of that name and you pass a different one of those types, the call is refused rather than adding a second column under the same name; read the column's real type from get_watchlist_contents (preset='table') and pass that.
A 'cbi' column is an existing CB Insights data column (Total Funding, Mosaic, Sector, HQ Country) or an audit column (Added date, Added by). Call get_watchlist_column_catalog first for its id_column_type. Its values are filled in by CB Insights and cannot be set here, so its entry carries no column_id. Adding one that is already on the watchlist is a no-op reported as status: already_present; re-adding a deleted audit column restores its previous values and reports status: restored.
Several 'cbi' columns may be added in one call. Each outcome is reported under added, and an id the watchlist doesn't offer is listed under errors — the rest are still added. The watchlist must already contain at least one company.
Type-specific arguments must match type — passing options for a text column, say, is an error rather than being ignored.
Parameters (1 required, 8 optional)
typestringColumn type. 'text', 'select' (a set of labeled options), 'number' and 'date' create a custom column you fill in yourself with set_watchlist_cell_values. 'cbi' adds an existing CB Insights data column, whose values are filled in automatically.
textselectnumberdatecbicolumnsarrayOnly for type='cbi': the columns to add, one entry each — get the ids from get_watchlist_column_catalog. Several may be given to add them in one call. An id the watchlist doesn't offer is reported under errors and skipped; the rest are still added.
[]date_formatstringOnly for a 'date' column: 'MM_DD_YYYY' (default, MM/DD/YYYY) or 'DD_MM_YYYY' (DD/MM/YYYY). Changes the format of a date column called `name` if one already exists. Cell values are always entered as YYYY-MM-DD whatever the column displays.
nulldecimal_placesintegerOnly for a 'number' column: decimal places to display (0-6). Changes an existing number column called `name`, independently of `number_format` — pass either or both.
nullid_listintegerID of the watchlist to add the column to (from get_watchlists). Provide this or list_name.
nulllist_namestringName of the watchlist, matched case-insensitively; ambiguous or unknown names return alternates.
nullnamestringThe name to give a new custom column, or the name of an existing select/number/date column to reconfigure. Required for 'text', 'select', 'number' and 'date'; not accepted for 'cbi', which names columns by id. Accepts the 'Name (#7)' form get_watchlist_contents reports for duplicated column names.
nullnumber_formatstringOnly for a 'number' column: 'number' (default), 'currency', or 'percentage'. If a number column called `name` already exists, this changes its format — that is how you reformat a column after creating it. Display only; no stored value is changed.
nulloptionsarrayOnly for a 'select' column: the option labels (required for select). If this watchlist already has a select column called `name`, these are added to the options it already offers rather than creating a second column — so pass only the new labels. Adding one it already has is an error; read the current set from get_watchlist_contents (preset='table').
null