> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.itential.com/itential-platform/6/studio/tasks/reference/modify/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server. # modify > Reference for the modify workflow task, which creates a new variable from a modified copy of an existing variable by updating boolean, number, or string values. ## Task purpose The `modify` task creates a new variable from a modified copy of an existing variable. Its primary purpose is to modify an object key's boolean, number, or string value. `modify` can create a new variable from both job variables and the outgoing variables of tasks. It works with boolean, number, string, and object data types. It does not work with array data types and will not modify elements of an array within an object. ## Properties | Incoming | Description | | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `object_to_update` (required) | The variable to modify. You can modify job variables, a static value (useful for testing), or an earlier task's outgoing variable. | | `query` (optional) | If not using a query, set its reference task to `static` and delete the contents of its reference variable. When modifying values of boolean, number, or string type, the query is not used. If modifying an object and you only need to modify a specific field, specify a query for that field. | | `new_value` (required) | The new value, which can come from a job variable, a static value, or an earlier task's outgoing variable. The new value replaces the value passed in `object_to_update`. If `object_to_update` is an object and a query is specified, the new value replaces only the matching field. | | Outgoing | Description | | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `updated_object` | The modified value is assigned to the immutable variable `updated_object` and returned to the job. Optionally check the **Job Variables** checkbox to create a job variable from `updated_object` — the immutable variable remains and a new mutable job variable is created. When creating a job variable, provide a new name to avoid naming conflicts and improve clarity. | ## Examples ### Change a boolean value Change the boolean value of a job variable or a previous task's outgoing variable from `false` to `true`: ```javascript object_to_update = query = "" new_value = true ``` The value of `updated_object` (outgoing variable) will be `true`. ### Change a string value Change the string value of a job variable or a previous task's outgoing variable from `"before"` to `"after"`: ```javascript object_to_update = query = "" new_value = "after" ``` The value of `updated_object` (outgoing variable) will be `"after"`. ### Change a field value in an object Change the boolean value of the `"sync-status"` field in an object from `true` to `false`: ```javascript object_to_update = { "name": "cr1.atl", "sync-status": true } query = "sync-status" new_value = false ``` The value of `updated_object` (outgoing variable): ```json { "name": "cr1.atl", "sync-status": false } ``` ### Change a nested string field in an object Change the string value of the `"description"` field in an object: ```javascript object_to_update = { "name": "BMW-1", "description": "Northeast region", "endpoints": [ { "name": "NYC", "device": "er1.nyc" }, { "name": "BOS", "device": "er1.bos" } ] } query = "description" new_value = "New England Region" ``` The value of `updated_object` (outgoing variable): ```json { "name": "BMW-1", "description": "New England Region", "endpoints": [ { "name": "NYC", "device": "er1.nyc" }, { "name": "BOS", "device": "er1.bos" } ] } ``` > Reference for the modify workflow task, which creates a new variable from a modified copy of an existing variable by updating boolean, number, or string values.