# Dropdown default value

**URL:** <https://forum.bubble.io/t/dropdown-default-value/10684>\
**Category:** Need help\
**Created:** [February 19, 2017, 10:54pm UTC](https://forum.bubble.io/t/dropdown-default-value/10684 "2017-02-19T22:54:05Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![infinitezahoor](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/infinitezahoor/32/9571_2.png) [@infinitezahoor](https://forum.bubble.io/u/infinitezahoor)\
**Post date:** [February 19, 2017, 10:54pm UTC](https://forum.bubble.io/t/dropdown-default-value/10684/1 "2017-02-19T22:54:05Z")

</div>

I want to set the default value of a dropdown to be the name of current geographic location (country name) on page load. How can i do that ?

---

<div class="post-metadata">

**Author:** ![fayewatson](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/fayewatson/32/2686_2.png) [@fayewatson](https://forum.bubble.io/u/fayewatson)\
**Post date:** [February 19, 2017, 11:42pm UTC](https://forum.bubble.io/t/dropdown-default-value/10684/2 "2017-02-19T23:42:49Z")

</div>

Hi Zahoor 🙂 If you use the Searchbox element, you can extract the country name for the default value using these settings:

 ![](https://us1.discourse-cdn.com/bubble/original/2X/7/7c983f64ac0e458dade56f3881317442e2cd0d9b.jpg)

This way you can save it as a geographic address as well. Is this what you were hoping to achieve? Or do you need to use the Dropdown element with dynamic or static choices?

---

<div class="post-metadata">

**Author:** ![infinitezahoor](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/infinitezahoor/32/9571_2.png) [@infinitezahoor](https://forum.bubble.io/u/infinitezahoor)\
**Post date:** [February 20, 2017, 12:49am UTC](https://forum.bubble.io/t/dropdown-default-value/10684/3 "2017-02-20T00:49:55Z")

</div>

I want to use dropdown element with dynamic choices and then want to set a default value on page load.

---

<div class="post-metadata">

**Author:** ![fayewatson](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/fayewatson/32/2686_2.png) [@fayewatson](https://forum.bubble.io/u/fayewatson)\
**Post date:** [February 20, 2017, 1:41am UTC](https://forum.bubble.io/t/dropdown-default-value/10684/4 "2017-02-20T01:41:08Z")

</div>

What’s the choices source you are using for the dynamic choices? Can you share a screenshot or a link to your app?

---

<div class="post-metadata">

**Author:** ![infinitezahoor](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/infinitezahoor/32/9571_2.png) [@infinitezahoor](https://forum.bubble.io/u/infinitezahoor)\
**Post date:** [February 20, 2017, 2:24am UTC](https://forum.bubble.io/t/dropdown-default-value/10684/5 "2017-02-20T02:24:45Z")

</div>

I have database “Country” from which my dropdown D picks and shows country names. Now i want the dropdown to show the current visitor’s country as default value of dropdown **on page load** without any choice selection from app visitor.

 ![](https://us1.discourse-cdn.com/bubble/original/2X/4/4b4b3ea67ab627189c80a56605a09193306ff685.png)

---

<div class="post-metadata">

**Author:** ![fayewatson](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/fayewatson/32/2686_2.png) [@fayewatson](https://forum.bubble.io/u/fayewatson)\
**Post date:** [February 20, 2017, 2:42am UTC](https://forum.bubble.io/t/dropdown-default-value/10684/6 "2017-02-20T02:42:42Z")

</div>

Ok these settings should do it (let me know if not): 🙂

 ![](https://us1.discourse-cdn.com/bubble/original/2X/e/e1e495d8a16b9aabcd9b44d781004d2b899e0b6b.png)

---

<div class="post-metadata">

**Author:** ![infinitezahoor](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/infinitezahoor/32/9571_2.png) [@infinitezahoor](https://forum.bubble.io/u/infinitezahoor)\
**Post date:** [February 20, 2017, 4:07am UTC](https://forum.bubble.io/t/dropdown-default-value/10684/7 "2017-02-20T04:07:56Z")

</div>

I am getting this error, please help

![](https://us1.discourse-cdn.com/bubble/original/2X/f/f2ec878b027d980203f3af041bce9c617f9d5237.png)

---

<div class="post-metadata">

**Author:** ![infinitezahoor](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/infinitezahoor/32/9571_2.png) [@infinitezahoor](https://forum.bubble.io/u/infinitezahoor)\
**Post date:** [February 20, 2017, 4:15am UTC](https://forum.bubble.io/t/dropdown-default-value/10684/8 "2017-02-20T04:15:39Z")

</div>

![](https://us1.discourse-cdn.com/bubble/original/2X/9/9fbaa696ae8203405b4ef899ac23850ba272b9fd.png)

---

<div class="post-metadata">

**Author:** ![matt3](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/matt3/32/9647_2.png) [@matt3](https://forum.bubble.io/u/matt3)\
**Post date:** [February 20, 2017, 4:21am UTC](https://forum.bubble.io/t/dropdown-default-value/10684/9 "2017-02-20T04:21:21Z")

</div>

I would think for the default to be valid you would need to do a search for Country with a constraint that it is = to current geo :extract country. I’m assuming that you want the country to be a valid location currently in your data. Can you share a link?

---

<div class="post-metadata">

**Author:** ![fayewatson](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/fayewatson/32/2686_2.png) [@fayewatson](https://forum.bubble.io/u/fayewatson)\
**Post date:** [February 20, 2017, 4:23am UTC](https://forum.bubble.io/t/dropdown-default-value/10684/10 "2017-02-20T04:23:35Z")

</div>

Almost there! The Type of Choices should be “Text” for this, instead of “Country”. Since you’re needing to display the User’s current geographic location, and extracting the country, that is a text value, not a stored Country in your database. By changing the Type of Choices to Text, the choices source is composed of text values: Search for Country’s Names (list of texts) :plusitem “current geographic position: extract country” (single text value).

\*I assumed the Name field was type text in your database - is it type: geographic address?

---

<div class="post-metadata">

**Author:** ![infinitezahoor](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/infinitezahoor/32/9571_2.png) [@infinitezahoor](https://forum.bubble.io/u/infinitezahoor)\
**Post date:** [February 20, 2017, 4:29am UTC](https://forum.bubble.io/t/dropdown-default-value/10684/11 "2017-02-20T04:29:46Z")

</div>

Yes it worked for me now, great help thanks.

 ![](https://us1.discourse-cdn.com/bubble/original/2X/e/e06064033438f6af33bb31408e42e8f4831caa10.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [April 30, 2017, 11:03pm UTC](https://forum.bubble.io/t/dropdown-default-value/10684/12 "2017-04-30T23:03:46Z")

</div>

Closed on April 30, 2017, 11:03pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
