> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/tutorials/components/avatar/create-an-avatar-with-actions.md). Agents can also search and read this documentation through its [MCP server](https://docs.avonnicomponents.com/~gitbook/mcp).

# Create an avatar with actions

## Overview

This tutorial teaches you how to integrate the Avonni Avatar component with actions. We'll guide you through adding the Avatar component, configuring its appearance, and setting up custom actions to enhance user experience and interactivity. By the end of this tutorial, you'll have a fully functional Avatar component that displays user profile images and offers actionable options to your users.

The final result will look like this:

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fgit-blob-6f4551d631a0e43aecf204bd82a0a38724ed7f84%2F2023-04-05_20-20-38.png?alt=media" alt=""><figcaption></figcaption></figure>

## Steps

### 1. Create the recordID text variable

In the context of adding the Avonni Avatar Component, creating a recordID text variable and making it available for input is essential. This enables the Avatar Component to accurately match and display information associated with the current recordID.

{% @arcade/embed url="<https://app.arcade.software/share/xBPZnDhn5SaHgB7TvnMK>" flowId="xBPZnDhn5SaHgB7TvnMK" %}

### 2. Create the Get Records Collection

In adding the Avonni Avatar component with actions, creating a Get Records collection to fetch contact information is essential. By utilizing the recordID text variable we previously created, the Get Records collection will retrieve the specific contact data associated with that recordID. This enables the Avonni Avatar component to display the contact's avatar accurately.

* **Add a Get Records** element
* Linked to the **Contact Object**
* Filter by: **All Conditions are Met (AND)**
  * Contact ID EQUAL > RecordID (text variable created in [step 1](#1.-create-the-recordid-text-variable))

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fgit-blob-c35d734b673c99cb02b9ebd3fb8069d1cb90c5f7%2F2023-04-05_16-19-28.png?alt=media" alt=""><figcaption></figcaption></figure>

### 3. Create the screen flow and add the Avonni Avatar Component

{% @arcade/embed url="<https://app.arcade.software/share/5LNemyFeBk19eN9upzPH>" flowId="5LNemyFeBk19eN9upzPH" %}

### 4. Configure the Avonni Avatar Component

* Open the Component Builder
* Set fallback Icon Name >> "standard:contact"
* size >> large
* primary Text >> GetContact.fullName
* secondary Text >> GetContact.Email
* Add actions "Mark as primary" and "Delete"

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fgit-blob-8f0b53461a08666130ae644c5e10ae11fdff676d%2F2023-04-05_20-36-59.png?alt=media" alt=""><figcaption></figcaption></figure>

* Position: bottom right
* menu icon name: utility:edit

{% @arcade/embed url="<https://app.arcade.software/share/yGLBHjHqxvINn8WAM5UA>" flowId="yGLBHjHqxvINn8WAM5UA" %}

### 3. Add an interaction component

In this step, we'll create an interaction for the "Mark as primary" Avatar component action, which enhances the user experience by providing an intuitive way to update contact information. When triggered, this interaction will open another flow that will update a specific field. Users can conveniently modify the contact information directly from the dialog box, ensuring seamless and efficient editing. Adding this interaction empowers users with a straightforward and user-friendly approach to maintaining accurate contact data.

#### Steps to create the interaction

* From the Component Builder, click the **Interactions Tab** on the right side
* Define the interaction based on the target action
* See all the [interaction available here](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel.md) to find the one that will match with your use case.

{% hint style="info" %}
Don't forget [to pass the current recordID](https://docs.avonnicomponents.com/flow/tutorials/tips-and-tricks/how-to-pass-your-current-recordid-in-your-screen-flow.md) in your screen flow.
{% 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/flow/tutorials/components/avatar/create-an-avatar-with-actions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
