Skip to main content

Try a virtual custom field config without saving it.

POST/api/v1/virtual-custom-fields/testregisters:read

Runs the config as the Portal's Test button does and answers the rows the joined registers produce for the caller (each register is cut to the rows the caller may read before it is joined), up to limit. A config that names an inactive or missing template is 422; so is one the Portal cannot run (a column the register does not have, tables that are not joined), with the Portal's message. A field that filters by document values returns no rows here: save it and use execute_virtual_custom_field with a document. Nothing is saved. Needs Test Virtual Custom Fields, and View Custom Field Templates with access to each template the config names.

Scoperegisters:read
AsynchronousNo
MCP tooltest_virtual_custom_fields
Portal permissionstest_virtual_custom_fields

Parameters​

NameInTypeRequiredDescription
Docwize-Versionheaderstring (date)Optional

Request body​

Content typeType
application/jsonVirtualCustomFieldTestInput

Responses​

StatusDescriptionBody
200Success.application/json VirtualCustomFieldRows
400invalid_version, malformed_jsonapplication/problem+json Problem
401token_expired, unauthenticatedapplication/problem+json Problem
403forbidden, insufficient_scope, token_owner_inactiveapplication/problem+json Problem
405method_not_allowedapplication/problem+json Problem
406not_acceptableapplication/problem+json Problem
413payload_too_largeapplication/problem+json Problem
415unsupported_media_typeapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

Errors​

The problem codes this operation can answer with. Each code links to its page.

Schemas​

VirtualCustomFieldRows​

FieldTypeRequiredDescription
row_countintegerRequiredRows in rows. ≥ -2147483648; ≤ 2147483647
rowsarray of objectRequiredOne object per row, keyed by the names the config gives the columns (new_name of its rename_mapping) and, for a column it does not rename, by the custom field's name (register name - field name when two columns share a name). Dates are text, decimals strings.
total_rowsintegerRequiredRows the field produced for the caller; more than row_count when limit cut the answer. ≥ -2147483648; ≤ 2147483647

VirtualCustomFieldTestInput​

FieldTypeRequiredDescription
configobjectRequiredThe virtual custom field to try, as create_virtual_custom_field takes it: format virtual_custom_field, version 1, body {custom_fields, join_relationships}. Nothing is saved. A field that filters by document values returns no rows here, because no document is given.
limitinteger or nullOptionalRows to return, 100 by default, 1000 at most.