# Using the FORMAT Function in an Assignment Rule

When you want to assign a value using the FORMAT function (e.g., assign the current date to a date field in a specific format) you need to add the ‘function’ parameter to the ‘operand’ section of the message, and then the actual formatting string in the ‘value’ section.

&#x20;

```
{
    "context": {
        "user": "user_ID",
        "password": "XXXX",
        "project": {
            "name": "imp_payments_demo",
            "version": "1.0"
        },
        "workSet": {
            "name": "api_2_workset",
            "version": "1.1"
        }
    },
    "entity": {
        "step": {
            "name": "imp_enter_details",
            "version": "1.0"
        },
        "attribute": "test_string",      
        "operands": [
            {
                "operator": "ASSIGN",
                "function": "FORMAT",
                "value": "%D|yyyy-MM-dd"
            }      
        ]
    }
}
```

&#x20;

The return message will include the information on the rule that you created.

<figure><img src="/files/0Ir33FkGIf9lm1SL7OrI" alt=""><figcaption><p>Return message using FORMAT function</p></figcaption></figure>

In TDO, you can now see the rule that you created.

<figure><img src="/files/bLt1z5M6K3bYlVlGz6nT" alt=""><figcaption><p>Assignment Rule using FORMAT function</p></figcaption></figure>


---

# 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.apica.io/platform-docs/test-data-orchestrator-tdo/user-documentation/api-guide/assignment-rule-apis/create-assignment-rule/using-the-format-function-in-an-assignment-rule.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.
