# Read a capability with a dot in the name

**URL:** <https://community.homey.app/t/read-a-capability-with-a-dot-in-the-name/42409>\
**Category:** Questions & Help\
**Tags:** homeyscript\
**Created:** [February 4, 2021, 5:15pm UTC](https://community.homey.app/t/read-a-capability-with-a-dot-in-the-name/42409 "2021-02-04T17:15:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oscar\_Andersson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oscar_andersson/32/26933_2.png) [@Oscar\_Andersson](https://community.homey.app/u/Oscar_Andersson)\
**Post date:** [February 4, 2021, 5:15pm UTC](https://community.homey.app/t/read-a-capability-with-a-dot-in-the-name/42409/1 "2021-02-04T17:15:22Z")

</div>

I would like to read the current for one of three phases. The capability has a dot in the name so I would like to write something like:

var current = Watty.capabilitiesObj.‘measure\_current.L2’.value;

But that is not possible. Giving me error message:  
Unexpected string: Unexpected string

Also this isn’t possible:  
var current = Watty.capabilitiesObj.measure\_current.L2.value;  
Give me error message:  
“Cannot read property ‘L2’ of undefined”

How is the syntax for reading the capability with . in name?

---

<div class="post-metadata">

**Author:** ![Jero](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jero/32/17556_2.png) [@Jero](https://community.homey.app/u/Jero)\
**Post date:** [February 4, 2021, 5:24pm UTC](https://community.homey.app/t/read-a-capability-with-a-dot-in-the-name/42409/2 "2021-02-04T17:24:13Z")

</div>

> **[Property accessors - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors)**
>
> Property accessors provide access to an object's properties by using the dot notation or the bracket notation.

> [@Oscar\_Andersson](#):
>
> var current = Watty.capabilitiesObj.‘measure\_current.L2’.value;

var current = Watty.capabilitiesObj[‘measure\_current.L2’].value;

---

<div class="post-metadata">

**Author:** ![Oscar\_Andersson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oscar_andersson/32/26933_2.png) [@Oscar\_Andersson](https://community.homey.app/u/Oscar_Andersson)\
**Post date:** [February 4, 2021, 8:28pm UTC](https://community.homey.app/t/read-a-capability-with-a-dot-in-the-name/42409/3 "2021-02-04T20:28:39Z")

</div>

Works perfect, thanks.
