# How to Create Temporary User Avatars

*Skill Level: Intermediate*

## Before You Begin

* Know the basics of [Databases](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/database), [Actions](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/action-basics/action-basics), and [Screens](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/component-basics/inserting-and-editing-screens) and [Components](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/component-basics/design-basics)
* Recognize that this implementation requires referencing the Image URL instead the Image property from the Adalo Database. Anywhere you want to display a placeholder, you must use URL as the source rather than the Database Image property.
* Ensure you have a signup screen, login, screen, home screen, and profile screen in your app
* You do not need a paid Adalo plan to implement this feature

## Walkthrough

{% tabs %}
{% tab title="Simple" %}
In this walkthrough, we're going to set up some temporary avatars for your users so that each user has a unique and personalized avatar to start off with. It sounds fancy, but it's easier to do than you might think!

**1.)** First, let's add a **Text** property to our Users collection titled **"Profile Pic URL"**. If you need help doing this, we suggest taking a look at our [Database](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/database) guide first.&#x20;

**2.)**  Then add an **Image** property to the Users collection as well named **"Profile Pic"**. This will allow your users to upload their own photos to replace the temporary avatar image.&#x20;

**3.)**  Now that we have the properties in our database to hold the image information, let's add an action to the Home screen itself by clicking on the label for the screen in the top left of the screen's wireframe, then clicking on the **Actions** section dropdown.

**4.)**  Underneath the **Click Actions** section, click **+ Add Action**, then choose **Update > Logged In User**

**5.)**  To generate our temporary avatar image, we're going to use a free service called [Dicebear](https://avatars.dicebear.com/) to generate a link to be stored in the **"Profile Pic URL"** field we created. While there are several options for types of avatars to generate (see the [Learn More](#learn-more) section below), we're going to use the **`initials`** option. To do this simply copy and paste the URL below into the **"Profile Pic URL"** field of the the Update action.

```
https://avatars.dicebear.com/api/initials/
```

**6.)**  This link by itself will not create the image we need just yet. We need to add in the personalized phrase to use, which in this case is just the user's full name.  Let's append some magic text of the **Logged In User's > Full Nam**e to the end of the link along with **`.svg`**.  Your update action should look like this:

![](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj5AlMdIrea8auGCjy1%2F-Mj5WM1AE6xNoGuFDtHF%2FScreen%20Shot%202021-09-08%20at%201.47.04%20PM.png?alt=media\&token=4abbc160-4347-4bf2-ab50-fbebfbbdb997)

**7.)**  Next, we need this action to only happen if the user does not yet have a profile picture URL already. To do this, click on **Show Advanced** in the Update action, then set the **When does this happen?** dropdown to **Sometimes**

**8.)**   In the **This action will only happen if...** dropdown choose **More > Logged In User > Profile Pic URL.**  Ensure the next dropdown that appears is set to **Equal to** and leave the last dropown set to **Empty**.  This will make sure that we only give the user a temporary profile pic if they don't have a profile picture yet.

**9.)**  Next, we need to make sure that if a user uploads a picture of their own, that the "Profile Pic URL" property is updated with the new URL.  Add a form to the Profile screen in your app by clicking on the big plus sign <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mh_MSkyJ6upDG5lhkw6%2F-Mh__y0uWngB2F2ij_M9%2FScreen%20Shot%202021-08-20%20at%205.03.57%20PM.png?alt=media&#x26;token=bddd66b8-04d8-40ec-b57f-bf955f64fb68" alt="" data-size="line"> in the top left of the Builder. &#x20;

**10.)**  In the new form's settings, click on the Form section dropdown if not already selected and set the **Which Data Collection** dropdown to **Users**.

**11.)**  Then in the **What do you want the form to do?** dropdown choose **Update Logged in User.**&#x20;

**12.)**  In the **Fields** section dropdown, remove **Email**, **Password**, and **Profile Pic URL** from the **Visible Fields** section by clicking on the trash can icon next to each property. &#x20;

**13.)**  Click on the Submit Button section dropdown, then click **+ Add Another Action** to add another action to the submit button that will **Update > Logged In User** again.

**14.)**  In the action's settings, let's use Magic Text to set the **"Profile Pic URL"** to be the **Logged in User** > **Profile Pic** > **URL**

**15.)**  Now, anywhere you want to display the user's profile picture, be sure to set the **Image source** to **URL** in the dropdown and for the value, put in the Magic Text **Logged in User's > Profile Pic URL**
{% endtab %}

{% tab title="In-Depth" %}
In this walkthrough, we're going to set up some temporary avatars for your users so that each user has a unique and personalized avatar to start off with. It sounds fancy, but it's easier to do than you might think!

**1.)** First, let's add a **Text** property to our Users collection titled **"Profile Pic URL"**. If you need help doing this, we suggest taking a look at our [Database](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/database) guide first.&#x20;

**2.)**  Then add an **Image** property to the Users collection as well named **"Profile Pic"**. This will allow your users to upload their own photos to replace the temporary avatar image. Now your Users collection should look like this:

![Users collection with an image and text property for ](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj0iK5DkIiE-UgkO_Mx%2F-Mj0iVMyMklFpIJWRESp%2FScreen%20Shot%202021-09-07%20at%203.26.28%20PM.png?alt=media\&token=dfa5495c-cc46-47f1-80eb-17fa1f3e698d)

**3.)**  Now that we have the properties in our database to hold the image information, let's add an action to the Home screen itself by clicking on the label for the screen in the top left of the screen's wireframe, then clicking on the **Actions** section dropdown.&#x20;

![Clicking on the home screen's wireframe label](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj594arcP-RscX5QJIM%2F-Mj59zibZZEOUg81jpeO%2Fclick%20on%20home%20label.gif?alt=media\&token=37d285d8-2796-4602-83a8-4e77b3756052)

**4.)**  Underneath the **Click Actions** section, click **+ Add Action**, then choose **Update > Logged In User**

![Adding an update action to update the Logged in User](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj594arcP-RscX5QJIM%2F-Mj5AQqacTulFv2p9byY%2Fadd%20update%20action.gif?alt=media\&token=c264d040-6cdf-4241-b006-5611e6229221)

**5.)**  To generate our temporary avatar image, we're going to use a free service called [Dicebear](https://avatars.dicebear.com/) to generate a link to be stored in the **"Profile Pic URL"** field we created. While there are several options for types of avatars to generate, we're going to use the **`initials`** option. To do this simply copy and paste the URL below into the **"Profile Pic URL"** field of the the Update action.

```
https://avatars.dicebear.com/api/initials/
```

**6.)**  This link by itself will not create the image we need just yet. We need to add in the personalized phrase to use, which in this case is just the user's full name.  Let's append some magic text of the **Logged In User's > Full Nam**e to the end of the link along with **`.svg`**.  Your update action should look like this:

![Sample action that updates the Logged In User's Profile Pic URL](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj5AlMdIrea8auGCjy1%2F-Mj5WM1AE6xNoGuFDtHF%2FScreen%20Shot%202021-09-08%20at%201.47.04%20PM.png?alt=media\&token=4abbc160-4347-4bf2-ab50-fbebfbbdb997)

**7.)**  Next, we need this action to only happen if the user does not yet have a profile picture URL already. To do this, click on **Show Advanced** in the Update action, then set the **When does this happen?** dropdown to **Sometimes**

**8.)**   In the **This action will only happen if...** dropdown choose **More > Logged In User > Profile Pic URL.**  Ensure the next dropdown that appears is set to **Equal to** and leave the last dropown set to **Empty**.  This will make sure that we only give the user a temporary profile pic if they don't have a profile picture yet.

![Setting the conditional update action](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj5WRotDUnzCVpyDw--%2F-Mj5WywTdVCgzoZJ99GD%2FScreen%20Shot%202021-09-08%20at%201.49.53%20PM.png?alt=media\&token=79e94a47-ecc0-4744-8019-77fb3298e990)

**9.)**  Next, we need to make sure that if a user uploads a picture of their own, that the "Profile Pic URL" property is updated with the new URL.  Add a form to the Profile screen in your app by clicking on the big plus sign <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mh_MSkyJ6upDG5lhkw6%2F-Mh__y0uWngB2F2ij_M9%2FScreen%20Shot%202021-08-20%20at%205.03.57%20PM.png?alt=media&#x26;token=bddd66b8-04d8-40ec-b57f-bf955f64fb68" alt="" data-size="line"> in the top left of the editor.

![Adding a form to profile screen](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj5ZUXy5qJL-y9GHTk8%2F-Mj5_4gbV2jKmn97YAkB%2Fadd%20a%20form%20to%20profile.gif?alt=media\&token=6b40aa16-5faf-45cd-951a-47b670cace42)

**10.)**  In the new form's settings, click on the Form section dropdown if not already selected and set the **Which Data Collection** dropdown to **Users**.  Then, in the **What do you want the form to do?** dropdown choose **Update Logged in User.**

![](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj5rVSI_y9MIAPMdW5p%2F-Mj5rwyNecIeqUiDwUj7%2Fupdate%20logged%20in%20user%20form%20action.gif?alt=media\&token=33e41d4a-89aa-4404-a79d-8bfe3d468dbd)

**11.)**  In the **Fields** section dropdown, remove **Email**, **Password**, and **Profile Pic URL** from the **Visible Fields** section by clicking on the trash can icon next to each property.

![](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj5rVSI_y9MIAPMdW5p%2F-Mj5sLDGDAbEIs0AOudN%2Fremoving%20fields.gif?alt=media\&token=71d5fb9d-9660-4c37-883e-701d2a45df9c)

**12.)**  Click on the Submit Button section dropdown, then click **+ Add Another Action** to add another action to the submit button that will **Update > Logged In User** again.

![](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj5rVSI_y9MIAPMdW5p%2F-Mj5sj5FbRwrQprRt4Yt%2Fadd%20another%20update%20action.gif?alt=media\&token=9c0f724d-414f-417b-ae00-f2568f2612a1)

**13.)**  In the action's settings, let's use Magic Text to set the **"Profile Pic URL"** to be the **Logged in User** > **Profile Pic** > **URL**

![](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj5rVSI_y9MIAPMdW5p%2F-Mj5tGF8EOaWWhvyYcCh%2Fset%20magic%20text%20for%20update.gif?alt=media\&token=f68fd015-a8c5-47b6-81f7-d370adc22a57)

**14.)**  Now, anywhere you want to display the user's profile picture, be sure to set the **Image source** to **URL** in the dropdown and for the value, put in the Magic Text **Logged in User's > Profile Pic URL**

![](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj5rVSI_y9MIAPMdW5p%2F-Mj5tjidNmbhNXSJ8MBz%2Fset%20image%20source.gif?alt=media\&token=81c941ac-39b8-44ad-b696-8729870d4e35)
{% endtab %}
{% endtabs %}

## Example

Now your users will immediately have a temporary, dynamic, and personalized avatar for their profile picture upon signup. If you would like to view or clone the app used to create this walkthrough, please [click here](https://previewer.adalo.com/8a572481-cc44-4259-a31d-d3961b313dda).

## Learn More

* The look and feel of the avatar is determined by whatever information you Magic Text into the link. For example, if you send the user's Full Name in the link such as Johnny Test, the initials returned will be JT.
* You can customize what type of avatars are created simply by changing the option in the endpoint from initials to one of the other values in the table below.  Dicebear also offers some customization options for each avatar type, but that is beyond the scope of this help guide. For more information, please visit the [Dicebear website](https://avatars.dicebear.com/). To use these types in the table below simply replace **`initials`** used in **Step 5** with the value from the table.

{% hint style="info" %}
While most of the avatar types are free to use, it's important to pay attention to their [licenses ](https://avatars.dicebear.com/licenses)so that you can give credit to the artist if it is required.
{% endhint %}

| Avatar Type             | Sample                                                                                                                                                                                                                                                                          |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`avataaars`**         | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4fwsP-QaJS7_Yfdfe%2F-Mj4gYbM3iFGVIM5-H0H%2Favataaars%20example.svg?alt=media&#x26;token=9cb95c54-256a-47eb-b7ff-68de9ba121d0" alt="" data-size="original"> |
| **`big-ears`**          | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4fwsP-QaJS7_Yfdfe%2F-Mj4gp0JhIoH-nY-P8R9%2Fdownload.svg?alt=media&#x26;token=7016dfb0-58aa-42cb-b641-d6bb056e6f63" alt="" data-size="original">            |
| **`big-ears-neutral`**  | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4fwsP-QaJS7_Yfdfe%2F-Mj4hHa4KSCD7fZatX2-%2Fdownload%20(1).svg?alt=media&#x26;token=a004f1f5-87f6-4349-a130-c1728338cdc0" alt="" data-size="original">      |
| **`big-smile`**         | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4fwsP-QaJS7_Yfdfe%2F-Mj4pLQAqBSx9CH9AzSY%2Fbig%20smile.svg?alt=media&#x26;token=cc611bd0-3bdd-430d-ba05-727891af4fe6" alt="" data-size="original">         |
| **`bottts`**            | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4fwsP-QaJS7_Yfdfe%2F-Mj4pSIrlvjfIyfCJlKb%2Fbottts.svg?alt=media&#x26;token=f0d7d45c-5c46-445a-a315-b08b5b837c59" alt="" data-size="original">              |
| **`croodles`**          | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4fwsP-QaJS7_Yfdfe%2F-Mj4pb7d_VlfsQtkxTBT%2Fcroodles.svg?alt=media&#x26;token=d1f55be8-2ae5-4257-8dc2-683f756542dc" alt="" data-size="original">            |
| **`croodles-neutral`**  | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4fwsP-QaJS7_Yfdfe%2F-Mj4pkrUlxg9G1gXRbyC%2Fcroodles-neutral.svg?alt=media&#x26;token=fdbce5b4-c4dc-4347-b853-6361f7a20ea2" alt="" data-size="original">    |
| **`gridy`**             | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4fwsP-QaJS7_Yfdfe%2F-Mj4pwcqOh_Z2UjHB5Wi%2Fgridy.svg?alt=media&#x26;token=fbbf1f63-8f70-477f-8217-a66aabfa3b56" alt="" data-size="original">               |
| **`identicon`**         | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4fwsP-QaJS7_Yfdfe%2F-Mj4qFkBF6iDSNjUSLw2%2Fidenticon.svg?alt=media&#x26;token=d3deae3d-dce6-4854-8990-fd0cf084ca9d" alt="" data-size="original">           |
| **`initials`**          | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4fwsP-QaJS7_Yfdfe%2F-Mj4qP7AUZzdaOEwYWWU%2Finitials.svg?alt=media&#x26;token=825066a1-b611-4f60-9ef8-96124126cbf3" alt="" data-size="original">            |
| **`jdenticon`**         | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4fwsP-QaJS7_Yfdfe%2F-Mj4qXCtuxyHdMUriVHC%2Fjdenticon.svg?alt=media&#x26;token=cb1cb4b7-0f96-4feb-88e3-134b14068dcb" alt="" data-size="original">           |
| **`micah`**             | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4fwsP-QaJS7_Yfdfe%2F-Mj4qfl0pWdro4KD_RYg%2Fmicah.svg?alt=media&#x26;token=1883f345-ea7a-4787-96a8-fe6e8b348c8c" alt="" data-size="original">               |
| **`miniavs`**           | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4fwsP-QaJS7_Yfdfe%2F-Mj4qnaE_I7xuA_pE96o%2Fminiavs.svg?alt=media&#x26;token=2a925771-03e9-4720-abbb-2ab8ae4308bf" alt="" data-size="original">             |
| **`open-peeps`**        | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4qp8_RCEQS6HIvlti%2F-Mj4r01r_lppJQzWWUhn%2Fopen-peeps.svg?alt=media&#x26;token=10365ac3-cf2b-43f1-93b0-26deb94607ee" alt="" data-size="original">          |
| **`personas`**          | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4qp8_RCEQS6HIvlti%2F-Mj4rAkVcMPN1dwQv5NA%2Fpersonas.svg?alt=media&#x26;token=58c6ae99-9509-431c-a61b-b6ee6a833277" alt="" data-size="original">            |
| **`pixel-art`**         | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4qp8_RCEQS6HIvlti%2F-Mj4rO4GGyYQV_Bptch6%2Fpixel-art.svg?alt=media&#x26;token=d9d80cb8-934c-432b-8ea3-5e4d10ce1223" alt="" data-size="original">           |
| **`pixel-art-neutral`** | <img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhGHkPsv15svPIU5I7C%2F-Mj4qp8_RCEQS6HIvlti%2F-Mj4rYQ3ex3fqCa1OtLQ%2Fpixel-art-neutral.svg?alt=media&#x26;token=07954e2a-48bf-4115-99a2-439643ad0f5d" alt="" data-size="original">   |

## Help

If you need additional help with this article, you can always ask in our[ community forum](https://forum.adalo.com/)! Be sure to paste the link to this article in your post as well!

Do you have a tutorial or help doc request? [Let us know!](https://ideas.adalo.com/tutorial-requests)
