# Result Objects

## **User Defined Properties**

The next parameter in the callback function is an array of result objects. Result objects contain the following properties:

### **entity**

**required** | *object*

The entity object for this result that was passed in via the `entities` parameter of the `doLookup` method.  You should treat the entity object passed to the `doLookup` method as being immutable (i.e., you should not change any properties on the entity object).

### **displayValue**

**optional** | *string* | default: entity.value

A string value that can be used to change how the entity is displayed in the notification window. By default this value is set to `entity.value`.  In general you will not include this value and let the default value be used.

### **isVolatile**

**optional |** *boolean* **|** default: false

If set to true, this result object will not be be cached. The default value is `false` meaning all result objects are cached in the Integration cache.

### **data**

**required |** *object*

Contains contextual data for the `entity`. If set to `null`, indicates to the Polarity caching system that no results are available for the specified `entity`.

**data.summary** (required | *array of strings*)

An array of strings that are converted into summary tags within the notification window. Note that these strings support HTML markup.

**data.details** (required | *object*)

Data you would like to return from the integration and make available to the template and component logic. If you are using the default template then the values contained within the `details` object will be rendered into a key-value table.

```javascript
// example results array containing two result objects.  
// One result object with data, and one without
let results = [
    {
        entity: entityObject1,
        displayValue: entityObject1.value.toUpperCase(),
        isVolatile: false,
        data: {
            summary: ['Tag 1', 'Tag2'],
            details: {
                rows: [
                    {
                    email: 'ed@polarity.io'                    
                    }
                ]
            }
        }
    },
    // this entity object had no results so we set `data` to null
    // this indicates to the caching system that we should cache the
    // fact that there was no data for this lookup
    {
        entity: entityObject2,
        data: null            
    }
]
```

## Enrichment Properties

In addition to properties that are defined by the integration developer, the Polarity Server will enrich the result object with additional information.  The following properties are added to your result object and are available in your [templates](/integrations/build-an-integration/customizing-the-overlay-window/templates.md) and [component](/integrations/build-an-integration/customizing-the-overlay-window/component-file.md) files.

### **isCached**

Polarity adds an `isCached` field to the result object. You can use this to check whether or not a result is being returned from the integration cache.


---

# Agent Instructions: 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:

```
GET https://docs.polarity.io/integrations/build-an-integration/main/dolookup/result-objects.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
