Skip to main content
Add one record (a deal, an account, any row) to a data table, and return it. Call get_data_table first: its fields give the ids to write, the type each value takes, the labels a picklist accepts and editable (false for a lookup, which cannot be written), and its adjustment_reasons say whether a reason is required. One record per call, meant for adjustments: bulk loading is an Excel import in the Qobra web app. Statements are not recalculated by this call, just as when a record is added in the web app. To refresh them, call recalculate_statements on the users and the period the record counts for. Without full write access to data tables, write through a view of the table shared with you with edit rights, passed as view_id: the record has to fall inside the view’s filter. Requires write permission on data tables, or a view shared with edit rights. Every write is recorded in the audit trail as the Qobra MCP agent.

Parameters

Body

string
required
Id of the data table, from list_data_tables.
object[]
required
The cells to set, one per field. A field left out takes its default; the name field defaults to ‘New record’.
string
One of the table’s adjustment_reasons (get_data_table): required when that list is not null, refused when it is null (use comment for a free-text note).
string
Free-text note kept in the record’s history.
string
Id of one of the table’s views, to write through. Required when your write access comes from shared views (only records its filter holds can be written); omit it with full write access.
The call is refused, with a message naming the problem, when a field_id is unknown or listed twice, when a field is a lookup, when a value does not match its field’s type or picklist options — or, for a link, is not the id of a record of the linked table — when the name field is set to an empty or null value, when an amount’s currency is neither the company currency nor one list_exchange_rates lists, when the record would fall outside the filter of the view_id it is written through, when the table requires a reason and none from its adjustment_reasons was passed, or when a reason is passed but the table takes none. A cell sent without a currency is never refused for its currency. To write an amount in a new currency, give that currency an exchange rate with update_exchange_rates first.

Example

Response

Body

object
The table of the record; its fields name the record’s values in order. It is the same row list_data_tables returns; see that page for the full field breakdown.
object
The record as it now exists, the same row list_data_table_records returns, so the id can be reused straight away. Its values are read in the order of data_table.fields. See list_data_table_records for the full field breakdown.