[comment]: # translation:outdated

[comment]: # ({37d26905-37d26905})
# templatescreen.get

[comment]: # ({/37d26905-37d26905})

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

`integer/array templatescreen.get(object parameters)`

The method allows to retrieve template screens according to the given
parameters.

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

[comment]: # ({c902bf34-c902bf34})
### Parameters

`(object)` Parameters defining the desired output.

The method supports the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data_types)|Description|
|---------|---------------------------------------------------|-----------|
|hostids|string/array|Return only template screens that belong to the given hosts.|
|screenids|string/array|Return only template screens with the given IDs.|
|screenitemids|string/array|Return only template screens that contain the given screen items.|
|templateids|string/arary|Return only template screens that belong to the given templates.|
|noInheritance|flag|Do not return inherited template screens.|
|selectScreenItems|query|Return the screen items that are used in the template screen in the `screenitems` property.|
|sortfield|string/array|Sort the result by the given properties.<br><br>Possible values are: `screenid` and `name`.|
|countOutput|boolean|These parameters being common for all `get` methods are described in detail in the [reference commentary](/manual/api/reference_commentary#common_get_method_parameters).|
|editable|boolean|^|
|excludeSearch|boolean|^|
|filter|object|^|
|limit|integer|^|
|output|query|^|
|preservekeys|boolean|^|
|search|object|^|
|searchByAny|boolean|^|
|searchWildcardsEnabled|boolean|^|
|sortorder|string/array|^|
|startSearch|boolean|^|

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

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

`(integer/array)` Returns either:

-   an array of objects;
-   the count of retrieved objects, if the `countOutput` parameter has
    been used.

[comment]: # ({/7223bab1-7223bab1})

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

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

[comment]: # ({2e88c019-2e88c019})
#### Retrieve screens from template

Retrieve all screens from template "10001" and all of the screen items.

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "templatescreen.get",
    "params":  {
        "output": "extend",
        "selectScreenItems": "extend",
        "templateids": "10001"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

``` {.java}
{
    "jsonrpc": "2.0",
    "result": [
        {
            "screenid": "3",
            "name": "System performance",
            "hsize": "2",
            "vsize": "2",
            "templateid": "10001",
            "screenitems": [
                {
                    "screenitemid": "20",
                    "screenid": "3",
                    "resourcetype": "0",
                    "resourceid": "433",
                    "width": "500",
                    "height": "120",
                    "x": "0",
                    "y": "0",
                    "colspan": "1",
                    "rowspan": "1",
                    "elements": "0",
                    "valign": "1",
                    "halign": "0",
                    "style": "0",
                    "url": ""
                },
                {
                    "screenitemid": "21",
                    "screenid": "3",
                    "resourcetype": "0",
                    "resourceid": "387",
                    "width": "500",
                    "height": "100",
                    "x": "0",
                    "y": "1",
                    "colspan": "1",
                    "rowspan": "1",
                    "elements": "0",
                    "valign": "1",
                    "halign": "0",
                    "style": "0",
                    "url": ""
                },
                {
                    "screenitemid": "22",
                    "screenid": "3",
                    "resourcetype": "1",
                    "resourceid": "10013",
                    "width": "500",
                    "height": "148",
                    "x": "1",
                    "y": "0",
                    "colspan": "1",
                    "rowspan": "1",
                    "elements": "0",
                    "valign": "1",
                    "halign": "0",
                    "style": "0",
                    "url": ""
                },
                {
                    "screenitemid": "23",
                    "screenid": "3",
                    "resourcetype": "1",
                    "resourceid": "22181",
                    "width": "500",
                    "height": "184",
                    "x": "1",
                    "y": "1",
                    "colspan": "1",
                    "rowspan": "1",
                    "elements": "0",
                    "valign": "1",
                    "halign": "0",
                    "style": "0",
                    "url": ""
                }
            ]
        }
    ],
    "id": 1
}
```

[comment]: # ({/2e88c019-2e88c019})

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

-   [Template screen
    item](/manual/api/reference/templatescreenitem/object#template_screen_item)

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

[comment]: # ({f973866f-f973866f})
### Source

CTemplateScreen::get() in
*frontends/php/include/classes/api/services/CTemplateScreen.php*.

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