# Using Multiple Operators in an Assignment Rule

Sometimes you may need to perform operations in assignment rules that use operators such as ‘Add’, ‘Subtract’, etc.  (Note that ‘Add’ is both a mathematical operator – add the values of two fields together – and also a text concatenation operator – add one string to the end of another string.)

&#x20;

To perform these operations, you send the multiple operators in a single ‘operands’ array, as shown below where we are assigning the value from the ‘balance’ field in the acts\_view to ‘test\_number’, and then subtracting 525 from that value.

&#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_number",           
                     "operands": [
                      {
                               "operator": "ASSIGN",
                               "value": {
                                "name": "acts_view",
                                "version": "1.0",
                               "attribute": "balance"
                     }
            },
                      {
                               "operator": "SUBTRACT",
                               "value": "525"
                     }
        ]
          }
}
```

&#x20;

When run in TDO, the response message for a successful call will look very similar to other rules assignment messages.  Both of the operators and their values will be reflected in the return message.

<figure><img src="/files/SlV2gPL9HpA0kH2jQ0LJ" alt=""><figcaption><p>Return Message using multiple operators</p></figcaption></figure>

In TDO, after this call runs, you will see the rule assigned to the field.

<figure><img src="/files/NXrAdlNYRjM1x4dvMfC3" alt=""><figcaption><p>Assignment Rule with multiple operators</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-multiple-operators-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.
