# 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="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FbYzUUlJM1XEk0ilASkuU%2Fimage.png?alt=media&#x26;token=0a1f259e-ec2f-4d0e-b11e-8daa576a89b0" 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="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FOZXcmXMPMI0lhINuRnl2%2Fimage.png?alt=media&#x26;token=a90ebc8f-62de-4b59-b4dc-c30683a0e9ac" alt=""><figcaption><p>Assignment Rule with multiple operators</p></figcaption></figure>
