# PotentialAction

Artifact: [androidx.appsearch:appsearch-builtin-types](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/builtintypes/PotentialAction.java+class:androidx.appsearch.builtintypes.PotentialAction) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
@ExperimentalAppSearchApi
@Document(name = "builtin:PotentialAction")
public class PotentialAction
```

<br />

*** ** * ** ***

An AppSearch document representing an action. This action schema type is used for the nested potentialActions field in entity schema types such as builtin:Thing or builtin:Timer.

- **name** - This is a unique identifier for the action, such as "actions.intent.CREATE_CALL". See [developer.android.com/reference/app-actions/built-in-intents/communications/create-call](https://developer.android.com/reference/androidx/appsearch/builtintypes/developer.android.com/reference/app-actions/built-in-intents/communications/create-call) for an sample Action type.
- **description** - A brief description of what the action does, such as "Create call" or "Create Message".
- **uri** - A deeplink URI linking to an action. Invoking the action can be done by creating an `https://developer.android.com/reference/android/content/Intent.html` object by calling `https://developer.android.com/reference/android/content/Intent.html#parseUri(java.lang.String, int)` with the deeplink URI. Creating a deeplink URI, and adding intent extras, can be done by building an intent and calling `https://developer.android.com/reference/android/content/Intent.html#toUri(int)`.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction.Builder` Builder for `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction#getDescription()()` Returns a string describing the action. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction#getName()()` Returns the BII action ID, which comes from Action IDs of Built-in intents listed at [developer.android.com/reference/app-actions/built-in-intents/bii-index](https://developer.android.com/reference/androidx/appsearch/builtintypes/developer.android.com/reference/app-actions/built-in-intents/bii-index). |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction#getUri()()` Returns the deeplink URI. |

## Public methods

### getDescription

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @Nullable String getDescription()
```

Returns a string describing the action.

### getName

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @Nullable String getName()
```

Returns the BII action ID, which comes from Action IDs of Built-in intents listed at [developer.android.com/reference/app-actions/built-in-intents/bii-index](https://developer.android.com/reference/androidx/appsearch/builtintypes/developer.android.com/reference/app-actions/built-in-intents/bii-index). For example, the "Start Exercise" BII has an action id of "actions.intent.START_EXERCISE".

### getUri

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @Nullable String getUri()
```

Returns the deeplink URI.

A deeplink URI is a URI that lets a user access a specific content or feature within an app directly. Users can create one by adding parameters to the app's base URI. To use a deeplink URI in an Android application, users can create an `https://developer.android.com/reference/android/content/Intent.html` object by calling `https://developer.android.com/reference/android/content/Intent.html#parseUri(java.lang.String, int)` with the deeplink URI. Creating a deeplink URI, and adding intent extras, can be done by building an intent and calling `https://developer.android.com/reference/android/content/Intent.html#toUri(int)`.