> For the complete documentation index, see [llms.txt](https://docs.polarity.io/integrations/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.polarity.io/integrations/build-an-integration/customizing-the-overlay-window/component-file/computed-properties.md).

# Computed Properties

Computed properties let you declare a function as a property that can be accessed from within your template as well as from within your component.

They are used to take normal properties (e.g., data that is returned by your integration in `block.data.details`) and manipulate or transform them.

As an example, the following is a computed property that takes a `firstName` and `lastName` property and returns a `fullName`.&#x20;

{% code title="component.js" %}

```javascript
'use strict';

polarity.export = PolarityComponent.extend({
    fullName: Ember.computed('block.data.details.firstName', 'block.data.details.lastName',
        function(){
            return `${this.get('block.data.details.firstName')} 
                ${this.get('block.data.details.lastName')}`;
    })    
});
```

{% endcode %}

The first argument or arguments are strings which define the properties that the computed property is dependent on.  Anytime any of the properties change in value, the computed property is recomputed.  In the example above, the computed property `fullName` is dependent on the `block.data.details.firstName` and `block.data.details.lastName` properties.&#x20;

Once you have created a computed property you can access that value directly within your templates using the curly brace syntax. &#x20;

{% code title="template.hbs" %}

```markup
<div>
    fullName: {{fullName}}
</div>
```

{% endcode %}

You can also access the computed property within the component and create computed properties based on computed properties. Anytime the `firstName` or `lastName` values change the `fullName` computed property is updated. When the `fullName` computed property gets updated the `fullNameLower` property will also get updated.

```javascript
'use strict';

polarity.export = PolarityComponent.extend({
    fullName: Ember.computed('block.data.details.firstName', 'block.data.details.lastName',
        function(){
            return `${this.get('block.data.details.firstName')} 
                ${this.get('block.data.details.lastName')}`;
    }),    
    fullNameLower: Ember.computed('fullName', function(){
        return this.get('fullName').toLowerCase();    
    })        
});
```

{% hint style="info" %}
For more information on computed properties please see <https://guides.emberjs.com/v3.4.0/object-model/computed-properties/>
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.polarity.io/integrations/build-an-integration/customizing-the-overlay-window/component-file/computed-properties.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
