testControlOnRecord
Requires permission settings:controls:manage.
Shows what a saved control or an unsaved rule would decide for one existing record, condition by condition. Nothing is saved, recorded or sent for approval. Requires settings:controls:manage.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query TestControlOnRecord($input: TestControlOnRecordInput!) {
testControlOnRecord(input: $input) {
notes
outcome
wouldRefuse
conditions {
actualNumber
actualFlag
actualText
fact
op
result
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query TestControlOnRecord($input: TestControlOnRecordInput!) {\n testControlOnRecord(input: $input) {\n notes\n outcome\n wouldRefuse\n conditions {\n actualNumber\n actualFlag\n actualText\n fact\n op\n result\n }\n }\n}",
"variables": {
"input": {
"documentId": "id",
"documentType": "string"
}
}
}
EOF
Variables:
{
"input": {
"documentId": "id",
"documentType": "string"
}
}
Response:
{
"data": {
"testControlOnRecord": {
"notes": [
"string"
],
"outcome": "string",
"wouldRefuse": true,
"conditions": [
{
"actualNumber": 0,
"actualFlag": true,
"actualText": "string",
"fact": "string",
"op": "string",
"result": true
}
]
}
}
}
testControlOnRecord(
input: TestControlOnRecordInput!
): ControlTestResultType!
Arguments
testControlOnRecord.input ● TestControlOnRecordInput! non-null input
The control or rule, and the record to test it on.
Type
ControlTestResultType object
What a control would decide for one record.