# Dynamic default - Choice component

**URL:** <https://community.glideapps.com/t/dynamic-default-choice-component/38883>\
**Category:** Ask for Help\
**Created:** [February 23, 2022, 1:05pm UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883 "2022-02-23T13:05:59Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)\
**Post date:** [February 23, 2022, 1:05pm UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/1 "2022-02-23T13:05:59Z")

</div>

Hi all,  
I’ve seen many posts about defaults on Choice components, but couldn’t find a discussion about the dynamic nature I’m looking for.  
Example of a use case:  
App will have a couple of messages it’ll want to send to the user (new order, shipping problem, etc).  
App will allow a user to receive a message in various channels (WhatsApp, SMS, email, etc).  
For each such message, a different default channel will apply. For example, shipping problem will have a default of SMS, while order confirmation will have a default of email.

So where’s the problem you ask? 🙂  
How do we allow the users to “override” the default channel, while still using a single component for what channel should be used for each message type. The choice component for “Channel” should have a pre-ticked option based on the default for that particular message type.  
I do not want to use a seperate component such as “override default”. Filtering out the default will also look bad and cumbersome to the user. The user should be able to simply untick the channel that was ticked as a default.  
We will of course make sure we still have at least one channel per message type, being the default one of not.

Anyone?  
Thanks

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 23, 2022, 4:05pm UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/2 "2022-02-23T16:05:23Z")

</div>

Set your defaults as part of the action that navigates to the screen.

---

<div class="post-metadata">

**Author:** ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)\
**Post date:** [February 23, 2022, 7:40pm UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/3 "2022-02-23T19:40:22Z")

</div>

But I can’t…  
Choice component A is the one which dictates what is the default for Choice component B.  
Is there a workaround by, perhaps, using an ITE column? The problem is that such a column cannot feed into the choice component.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [February 23, 2022, 11:58pm UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/4 "2022-02-23T23:58:09Z")

</div>

Do you have some screenshots of what your flow look like? Why can’t you set your defaults as part of the action that navigates to the screen like @Darren_Murphy said?

---

<div class="post-metadata">

**Author:** ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)\
**Post date:** [February 24, 2022, 7:23am UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/5 "2022-02-24T07:23:03Z")

</div>

> [@ThinhDinh](#):
>
> Do you have some screenshots

I  
Sure. Even better, [here’s a demo app](https://zealous-industry-4102.glideapp.io/).

In this example, the main dish has a default side dish  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/3/d3b65ac4a759deefcfcff3b9b1b0198d8fd65169.png)

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/e/7e2ab9305d1a2aa9cfb11cce78993df395bf96e0.png)

Once you select your main dish, the app should know which side dish to suggest as a default.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/4/d458c897d41d58175fd99afcb3e5aac61a788529.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 24, 2022, 7:39am UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/6 "2022-02-24T07:39:45Z")

</div>

Why are you using user specific columns for your choices?  
Those columns will be completely empty by default for all users. To fill them with data, you’d need to “view as” every single user in the builder once, and type the values in.

Anyway, I’ll have a look.

---

<div class="post-metadata">

**Author:** ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)\
**Post date:** [February 24, 2022, 7:41am UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/7 "2022-02-24T07:41:48Z")

</div>

> [@Darren\_Murphy](#):
>
> Why are you using user specific columns for your choices?

Using the “custom form” approach suggested by you 🙂  
Same form to be used by multiple users, at the same time.

Oh…Now I see what you mean. That’s a mistake. Prepared this example in 2 min and there are some casualties.  
USC or not, it doesn’t solve the default choice issue.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 24, 2022, 7:44am UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/8 "2022-02-24T07:44:31Z")

</div>

Choice components can be _writing_ to user specific columns, but they almost never should be _reading_ from them.

---

<div class="post-metadata">

**Author:** ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)\
**Post date:** [February 24, 2022, 7:45am UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/9 "2022-02-24T07:45:54Z")

</div>

> [@Darren\_Murphy](#):
>
> never should be _reading_ from them.

Indeed, a mistake on my side. Should be non-USC.  
For the sake of this question, it doesn’t really matter. Even for one user I don’t know how to manage this issue.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 24, 2022, 7:55am UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/10 "2022-02-24T07:55:51Z")

</div>

Before I look at this, I have a question.

In your demo app, you have your choice components on the first screen in a tab. Is this how it works in your real app, or are they hidden on a screen somewhere within a tab?

That is, does a user open a tab and this is the first thing they see, or do they tap on a button or some other actionable component to see this screen?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 24, 2022, 8:13am UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/11 "2022-02-24T08:13:45Z")

</div>

> [@Test\_Test](#):
>
> Once you select your main dish, the app should know which side dish to suggest as a default.

I don’t think this is possible. The problem is that you can’t assign an action to a choice component, and so there is no way to set the value of the second choice based on the selection in the first.

If you wanted to set a default for the first choice, that would be possible as long as you have an action that navigates to the screen.

But for this particular example, I think the best you can do is “make a suggestion” based on the first choice. Something like the following:

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [February 24, 2022, 8:17am UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/12 "2022-02-24T08:17:39Z")

</div>

you have to create a table with default choices that will be written to choices components (USC), when users go to that screen … very simple 😉  
I did many delivery apps … trust me… is all about how you structure the data, then everything will make sense and be easy… and don’t even think about using Glide native forms or edits… all have to be custom… even choice components custom… made from inline tiles list… you need to have a full control of what is going on, and have a ability to apply actions for every step your customer will make. choice component… form… edit… will not give you that option.

---

<div class="post-metadata">

**Author:** ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)\
**Post date:** [February 24, 2022, 10:00am UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/13 "2022-02-24T10:00:31Z")

</div>

> [@Darren\_Murphy](#):
>
> do they tap on a button or some other actionable component to see this screen?

Button, or another component that is assigned an action to “open a new screen”. However, both choices are in this new screen, so pre-filling with an action isn’t possible.

> [@Uzo](#):
>
> you have to create a table with default choices that will be written to choices components (USC),

I’m not sure I follow but I believe you’re suggest the same solution as @Darren_Murphy. If so, that’s not what I’m looking for. I don’t want to have the users switch between screens. All has to be in one screen.

> [@Uzo](#):
>
> even choice components custom… made from inline tiles list

That’s a direction I haven’t thought about. May I ask for more details?

---

<div class="post-metadata">

**Author:** ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)\
**Post date:** [February 24, 2022, 10:22am UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/14 "2022-02-24T10:22:52Z")

</div>

> [@Test\_Test](#):
>
> That’s a direction I haven’t thought about. May I ask for more details?

Answering myself, I think I now understand.  
That’s ingenious!!  
 ![chrome_rU901v6X4o](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/c/8c04ee0647f9683d17d1a1bbd090bdfc0f1016b5.gif)

Adding another screen recording to show the changing values  
 ![chrome_MyUc64pY86](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/2/52e9f4faaf378865227055cf1366166ebffbef93.gif)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [February 25, 2022, 10:23am UTC](https://community.glideapps.com/t/dynamic-default-choice-component/38883/15 "2022-02-25T10:23:44Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
