# getInfo() for Lightning Experience

Returns the state of the current utility as a `utilityInfo` object. This method is available for Lightning Web Components (LWC) only.

## Arguments

| Name        | Type   | Description                                            |
| ----------- | ------ | ------------------------------------------------------ |
| `utilityId` | string | The ID of the utility for which to retrieve the state. |

## LWC Sample Code

This component retrieves the `utilityInfo` object.

```javascript
import { LightningElement, wire } from 'lwc';
import { EnclosingUtilityId, getInfo } from 'lightning/platformUtilityBarApi';

export default class UtilityInfoExample extends LightningElement {
    @wire(EnclosingUtilityId) utilityId;

    async handleGetUtilityInfo() {
        try {
            if (!this.utilityId) {
                return;
            }
            const utilityInfo = await getInfo(this.utilityId);
            console.log(utilityInfo);
        }
        catch (error) {
            // handle error
        }
    }
}

```

To make your component available for use in a utility bar, specify the `lightning__UtilityBar` target in the [component’s configuration file](https://developer.salesforce.com/docs/platform/lwc/guide/use-config-for-utility-bar.md).

## Response

This method returns a promise that resolves to a `utilityInfo` object representing the enclosing utility, containing the following fields. The promise is rejected on error.

| Name                     | Type    | Description                                        |
| ------------------------ | ------- | -------------------------------------------------- |
| `id`                     | string  | The ID of the utility.                             |
| `isLoaded`               | boolean | Whether the utility is loaded.                     |
| `utilityLabel`           | string  | The label of the utility.                          |
| `utilityIcon`            | string  | The SLDS icon ID of the utility’s icon.            |
| `utilityIconVariant`     | string  | The SLDS icon variant of the utility’s icon.       |
| `utilityHighlighted`     | boolean | Whether the utility is highlighted.                |
| `utilityVisible`         | boolean | Whether the utility is visible.                    |
| `utilityPoppedOut`       | boolean | Whether the utility is popped out.                 |
| `panelHeaderLabel`       | string  | The label of the utility panel.                    |
| `panelHeaderIcon`        | string  | The SLDS icon ID of the utility panel’s icon.      |
| `panelHeaderIconVariant` | string  | The SLDS icon variant of the utility panel’s icon. |
| `panelHeight`            | integer | The height of the utility panel in pixels.         |
| `panelWidth`             | integer | The width of the utility panel in pixels           |

**See Also**

- [*MDN Web Docs*: async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function)
