[comment]: # ({bc514843-bc514843})
# screenitem.updatebyposition

[comment]: # ({/bc514843-bc514843})

[comment]: # ({ffaf9d9f-ffaf9d9f})
### Description

`object screenitem.updatebyposition(array screenItems)`

This method allows to update screen items in the given screen cells. If
a cell is empty, a new screen item will be created.

[comment]: # ({/ffaf9d9f-ffaf9d9f})

[comment]: # ({512ad4c0-512ad4c0})
### Parameters

`(array)` [Screen item properties](object#screen_item) to be updated.

The `x`, `y` and `screenid` properties must be defined for each screen
item, all other properties are optional. Only the passed properties will
be updated, all others will remain unchanged.

[comment]: # ({/512ad4c0-512ad4c0})

[comment]: # ({a38b62b4-a38b62b4})
### Return values

`(object)` Returns an object containing the IDs of the updated and
created screen items under the `screenitemids` property.

[comment]: # ({/a38b62b4-a38b62b4})

[comment]: # ({b41637d2-b41637d2})
### Examples

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({a0b8b508-a0b8b508})
#### Changing a screen items resource ID

Change the resource ID for the screen element located in the upper-left
cell of the screen.

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "screenitem.updatebyposition",
    "params": [
        {
            "screenid": "16",
            "x": 0,
            "y": 0,
            "resourceid": "644"
        }
    ],
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

``` {.java}
{
    "jsonrpc": "2.0",
    "result": {
        "screenitemids": [
            "66"
        ]
    },
    "id": 1
}
```

[comment]: # ({/a0b8b508-a0b8b508})

[comment]: # ({401ae440-401ae440})
### See also

-   [screenitem.update](update)

[comment]: # ({/401ae440-401ae440})

[comment]: # ({69ecd081-69ecd081})
### Source

CScreenItem::update() in
*frontends/php/include/classes/api/services/CScreenItem.php*.

[comment]: # ({/69ecd081-69ecd081})
