# Is there an 'else' function in WeWeb's formula?

**URL:** <https://community.weweb.io/t/is-there-an-else-function-in-wewebs-formula/3279>\
**Category:** How do I?\
**Created:** [June 29, 2023, 1:18pm UTC](https://community.weweb.io/t/is-there-an-else-function-in-wewebs-formula/3279 "2023-06-29T13:18:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamesPan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jamespan/32/3594_2.png) [@JamesPan](https://community.weweb.io/u/JamesPan)\
**Post date:** [June 29, 2023, 1:18pm UTC](https://community.weweb.io/t/is-there-an-else-function-in-wewebs-formula/3279/1 "2023-06-29T13:18:41Z")

</div>

I am trying to make a formula, where if the user got a profile image, it displays the image, and if not it displays a default image.

But I can’t find the else statement. What is the right way to do something like this in Weweb?

ps. Sorry for the noob questions, and probably more incoming, am new here and still trying to find my way.

---

<div class="post-metadata">

**Author:** ![AdrienB](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@AdrienB](https://community.weweb.io/u/AdrienB)\
**Post date:** [June 29, 2023, 1:30pm UTC](https://community.weweb.io/t/is-there-an-else-function-in-wewebs-formula/3279/2 "2023-06-29T13:30:01Z")

</div>

You can use two different formulas:  
If :

 ![FireShot Capture 209 - Groupe sos - PAIRS - WeWeb - editor.weweb.io](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/c/cf2506aca9bad015a82c8ea602f4ee425ea9540a.png)

ifEmpty:

 ![FireShot Capture 210 - Groupe sos - PAIRS - WeWeb - editor.weweb.io](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/1/1ccbb885abccda1bd079664513b10d6998bfc6ed.png)

---

<div class="post-metadata">

**Author:** ![JamesPan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jamespan/32/3594_2.png) [@JamesPan](https://community.weweb.io/u/JamesPan)\
**Post date:** [June 29, 2023, 1:33pm UTC](https://community.weweb.io/t/is-there-an-else-function-in-wewebs-formula/3279/3 "2023-06-29T13:33:38Z")

</div>

Thank you. 🙏

---

<div class="post-metadata">

**Author:** ![JamesPan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jamespan/32/3594_2.png) [@JamesPan](https://community.weweb.io/u/JamesPan)\
**Post date:** [June 29, 2023, 4:29pm UTC](https://community.weweb.io/t/is-there-an-else-function-in-wewebs-formula/3279/4 "2023-06-29T16:29:43Z")

</div>

@AdrienB Sorry for asking another noob question. But how and where do you set a default image like you did with the defaultImageUrl?

---

<div class="post-metadata">

**Author:** ![JamesPan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jamespan/32/3594_2.png) [@JamesPan](https://community.weweb.io/u/JamesPan)\
**Post date:** [June 29, 2023, 6:27pm UTC](https://community.weweb.io/t/is-there-an-else-function-in-wewebs-formula/3279/5 "2023-06-29T18:27:53Z")

</div>

People who are also looking for this question:

1. Upload your default image to WeWeb
2. Go to Formulas → Add formula
3. Give it a name, e.g. defaultImageUrl
4. Edit formula: Paste the URL of the uploaded image
5. click on Create formula

Now this formula is added to your project and will be accessible in the last tab with the name ‘From Project.’
