Introduction
A decision model answers a question you define about some data, typically a piece of text: yes or no, a choice from labels you supply, or a position on a scale you define. Omniscope offers two ways to use these answers:
- The AI Decision block asks questions about records and adds the answers as new fields.
- AI Decision Formulae call the same kind of assessment inside a workflow expression, so the answer can be combined with ordinary formula logic such as IF, comparisons and arithmetic, and used to choose which part of a workflow runs.
This article documents the three formulae - AI_DECISION_YESNO, AI_DECISION_CHOICE and AI_DECISION_SCORE - what each one returns, where you can use them, and worked examples.
At a glance
| Formula | Question type | Returns | Use a ... output field |
|---|---|---|---|
AI_DECISION_YESNO | Yes/No | The probability of "yes", a number from 0 to 1 | Decimal |
AI_DECISION_CHOICE | Multiple choice | One of the text labels you supply | Text |
AI_DECISION_SCORE | Ordered scale | A number: the first label is 0, the second 1, and so on | Decimal |
Arguments
The first two arguments are the same for all three formulae:
- Context - the text you want the AI to assess. This can be a single field such as
[Message], or text you build from several fields using ordinary formulas (concatenation,SUBSET_UNIQUESLIST, and so on). You can include labels and background information in the context to explain what the values mean. Numbers and dates must be converted to text explicitly, for example withTEXTVALUE. - Question - the question you want answered. As with the AI Decision block, write it precisely and state the criteria the answer should apply; the more explicit the question, the more consistent the answers.
The remaining arguments depend on the formula:
AI_DECISION_CHOICE: each choice is a separate argument after the question. You can supply between 2 and 255 distinct choices, for example"Positive", "Negative", "Neutral", "Mixed". Add them as separate arguments rather than a list or a semicolon-separated string.AI_DECISION_SCORE: the scale labels, ordered from lowest to highest, between 2 and 10 labels, for example"Not dissatisfied", "Slightly dissatisfied", "Very dissatisfied".
All three formulae:
- use the default model configured for the AI Decision Formulas integration, so no provider or API key appears in the formula.
- return
nullwhen the context is blank. - call the AI provider during workflow execution. While you are building the workflow, blocks containing these formulae show their fields in preview only.
AI_DECISION_YESNO
AI_DECISION_YESNO(context, question)
Returns the probability of a yes answer, a number from 0 to 1. It does not return a Boolean, so combine it with a threshold to make a decision:
IF(
AI_DECISION_YESNO(
[Message],
"Does the resident explicitly say that this problem continued or returned after a previous repair or technician visit? Answer no for a first report, an appointment question, or a confirmation that the problem is now fixed."
) >= 0.7,
"Flagged for review",
"OK"
)When you store the raw probability as a field, use a Decimal output field.
AI_DECISION_CHOICE
AI_DECISION_CHOICE(context, question, choice1, choice2, ...)
Returns one of the text labels you supply:
AI_DECISION_CHOICE(
[Feedback],
"What sentiment does this feedback express?",
"Positive",
"Negative",
"Neutral",
"Mixed"
)Use a Text output field. When you need a number, for example to select an Output Router output, wrap the result in VALUE and choose numeric labels (see the second example below).
AI_DECISION_SCORE
AI_DECISION_SCORE(context, question, label1, label2, ...)
Returns a numeric position on an ordered scale of labels. The first label is 0, the second is 1, and so on, and results can fall between levels:
AI_DECISION_SCORE(
[Feedback],
"How dissatisfied is this customer?",
"Not dissatisfied",
"Slightly dissatisfied",
"Very dissatisfied"
)With three labels the result is a number from 0 to 2, and an answer between "Slightly dissatisfied" and "Very dissatisfied" might come back as 1.4. Use a Decimal output field.
Where you can use them
AI Decision Formulae are workflow formulas, so they can be used anywhere a workflow expression is evaluated:
- Field organiser - in a formula field, combining the assessment with ordinary logic such as IF, comparisons and arithmetic.
- Control flow blocks - If Then Split, Output Router and Input Router, where the formula chooses which branch of the workflow runs.
In the formula picker they are listed under the AI category.
They are the right tool when the assessment has to sit inside a larger expression. If you want each question's answer as a field on every record - with per-choice or per-level probabilities - the AI Decision block is the better fit.
Set up
To use these formulae you need:
- A decision-capable provider: Jev, or a Custom provider with Jev-compatible (System One) support.
- In Admin > AI Settings > AI Integrations, the AI Decision Formulas integration enabled, with a Default model selected.
Two practical notes:
- Data sharing: when a workflow evaluates these formulae, the text supplied to them is sent to the configured decision provider. The AI Decision Formulas integration requires the provider's data sharing level to be Full datasets; see AI data sharing for the levels available.
- The formula uses the integration's default model, so changing the default model in AI Settings changes the model used by all workflows that use these formulae.
Use cases
- Flagging records for review: compare a YESNO probability with a threshold inside an IF to label only the records worth a human looking at, while leaving the rest untouched.
- Routing work: use CHOICE in an Output Router, If Then Split or Input Router to send records down different branches - for example to different teams - based on their free text.
- Scoring inside an expression: use SCORE as a number in further calculations or comparisons, such as building a combined risk score from text and structured fields.
- Repeated classification and scoring: for tasks run over and over, a decision model can be faster and cheaper than asking a generative model for the same answers.
Examples
Label messages for review (Field organiser)
Connect filtered messages to a Field organiser and create a text field with:
IF(
AI_DECISION_YESNO(
[Message],
"Does the resident explicitly say that this problem continued or returned after a previous repair or technician visit? Answer no for a first report, an appointment question, or a confirmation that the problem is now fixed."
) >= 0.7,
"Flagged for recurrence review",
"Below recurrence review threshold"
)Messages with a yes probability of at least 0.7 are labelled for review. Staff can then check each flagged message against the original text in a report view. A full walkthrough of this pattern is in the repairs service desk tutorial linked below.
Choose a processing path (Output Router)
To decide which team should follow up a repair, configure three outputs on an Output Router - 1 for Customer service, 2 for Maintenance, 3 for No follow-up needed - and use:
VALUE(
AI_DECISION_CHOICE(
SUBSET_UNIQUESLIST([Repairer Notes]),
"Which team should handle the next step for this repair, based on these visit notes? Choose 1 for Customer service when contact with the resident, access or appointment arrangements are needed before repair work can proceed. Choose 2 for Maintenance when technical review, parts or further repair work is needed without a stated access or appointment obstacle. Choose 3 for No follow-up needed only when the notes clearly establish that all required work has been completed. If unclear, choose 1 for clarification.",
"1",
"2",
"3"
)
)SUBSET_UNIQUESLIST combines the distinct visit notes into one text value, AI_DECISION_CHOICE picks one of the labels, and VALUE converts it to the number that selects the output. Only the chosen branch executes.
Score and compare (Field organiser)
Assess how dissatisfied a customer sounds and combine the score with an ordinary rule:
IF(
[Refund] = TRUE
AND AI_DECISION_SCORE(
[Feedback],
"How dissatisfied is this customer?",
"Not dissatisfied",
"Slightly dissatisfied",
"Very dissatisfied"
) >= 1.5,
"Priority review",
"Standard"
)Notes and limitations
- Blank context returns
null; if you need a fallback, wrap the formula inIForCATCH. - The AI call happens at execution time. During editing, blocks containing these formulae show their fields in preview only, and each execution makes one provider call per evaluated record.
- These formulae use the AI Decision Formulas integration's default model; there is no provider or model argument inside the formula itself.
- They work in workflow expressions only - Field organiser and Control flow blocks - not in report formulas.
Further reading
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article