# lead.getAttr()

### Получить значение переменной лида

```JavaScript
lead.getAttr(string $key)
```

##### Описание:

<span style="font-weight: 400;">Возвращает значение уже существующей переменной лида.</span>

##### Атрибуты:

<table border="1" id="bkmrk-%D0%98%D0%BC%D1%8F-%D0%A2%D0%B8%D0%BF-%D0%9E%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5-key-0" style="border-collapse: collapse; width: 100%; height: 89.3907px;"><tbody><tr style="background-color: #ced4d9; height: 29.7969px;"><td style="width: 33.3745%; height: 29.7969px;">Имя</td><td style="width: 33.3745%; height: 29.7969px;">Тип</td><td style="width: 33.3745%; height: 29.7969px;">Описание</td></tr><tr style="height: 29.7969px;"><td style="width: 33.3745%; height: 29.7969px;">key</td><td style="width: 33.3745%; height: 29.7969px;">string</td><td style="width: 33.3745%; height: 29.7969px;">Наименование переменной</td></tr></tbody></table>

##### Возвращает:

<span style="font-weight: 300;">**string** - </span>значение запрашиваемой переменной в виде строки

или

**null** - если переменная не была найдена.

##### Пример:

Получение значения переменной лида lead\_attribute:

```JavaScript
let lead_attribute_value = lead.getAttr('lead_attribute');
```

<div class="pointer-container" id="bkmrk-%C2%A0-1"><div class="pointer anim is-page-editable"><svg class="svg-icon" data-icon="link" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg><div class="input-group inline block"> <button class="button outline icon" data-clipboard-target="#pointer-url" title="Копировать ссылку" type="button"><svg class="svg-icon" data-icon="copy" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></button></div><svg class="svg-icon" data-icon="edit" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></div></div>