# Recipes

RuLa allows you to write quite complicated conditions and formulas. Here are some recipes or snippets or useful RuLa statements to use:

### Check if more information than expected is missing

Let's say we expect `first_payment_*` information to be missing in a certain step, but nothing else. Heres a recipe how to check for exactly that:

```
COUNT(
    CASE.missing_information_keys - [
        CASE.outcome_instance.first_payment_first_name.key(),
        CASE.outcome_instance.first_payment_last_name.key(),
        CASE.outcome_instance.first_payment_iban.key()
    ]
) > 0
```

We are using `CASE.missing_information_keys` for Atfinity to tell us the keys of information still needed but missing in the current case. With `INF.key()` we then compare these keys to the keys of information we expect to be missing in the case.\
Finally, we use the "infix [set difference operator](/rule-language/operators/list-operators/set_difference.md) ", the minus, to see if the list of `missing_information_keys` is empty after the remove all the known missing information and count the elements in this list.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/rule-language/recipes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
