# Only Allow One Selection From Two Data Blaze Tables

**URL:** <https://community.blaze.today/t/only-allow-one-selection-from-two-data-blaze-tables/35070>\
**Category:** Questions and Help\
**Created:** [January 24, 2024, 4:27pm UTC](https://community.blaze.today/t/only-allow-one-selection-from-two-data-blaze-tables/35070 "2024-01-24T16:27:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brad\_Hedinger](https://community.blaze.today/user_avatar/community.blaze.today/brad_hedinger/32/9060_2.png) [@Brad\_Hedinger](https://community.blaze.today/u/Brad_Hedinger)\
**Post date:** [January 24, 2024, 4:27pm UTC](https://community.blaze.today/t/only-allow-one-selection-from-two-data-blaze-tables/35070/1 "2024-01-24T16:27:14Z")

</div>

Need help with multiple Data Blaze menus pulling from the same table.

Use case: All my users will see the first DB menu, but only a small group of users will see the 2nd DB menu in addition to the first one. If an option is selected from 1 menu, I want the other menu to be forced to a specific row....Row 1. This row has "-" as the value in every cell.  
So ultimately, a user can only make a selection from one menu or the other.

Select the program this student wishes to change to:

**This list contains ONLY programs available 2/05/2024 and out.**  
{dbselect: SELECT `program name`, `program code`, `start dates`  
FROM Program\_Data  
WHERE `Start Dates` = "2/05/2024 and out"  
OR `program name` = "-"  
ORDER BY `program name`  
ASC; space=id; menu=yes; cols=50; name=program\_selector}

If you need to select an older program, use this list.

**This list contains ONLY programs available BEFORE 2/05/2024.**  
{dbselect: SELECT `program name`, `program code`, `start dates`  
FROM Program\_Data  
WHERE `Start Dates` = "Up to and including 1/08/2024"  
OR `program name` = "-"  
ORDER BY `program name`  
ASC; space=id; menu=yes; cols=50; name=program\_selector}

Selected Program Name: {=program\_selector["program name"]}  
Selected Program Code: {=program\_selector["program code"]}

---

<div class="post-metadata">

**Author:** ![scott](https://community.blaze.today/user_avatar/community.blaze.today/scott/32/30_2.png) [@scott](https://community.blaze.today/u/scott)\
**Post date:** [January 25, 2024, 7:54am UTC](https://community.blaze.today/t/only-allow-one-selection-from-two-data-blaze-tables/35070/2 "2024-01-25T07:54:22Z")

</div>

Rather than forcing the second menu to a specific value, would it make sense to wrap it with an {if} condition and hide it when a value in the first menu is selected?

---

<div class="post-metadata">

**Author:** ![Brad\_Hedinger](https://community.blaze.today/user_avatar/community.blaze.today/brad_hedinger/32/9060_2.png) [@Brad\_Hedinger](https://community.blaze.today/u/Brad_Hedinger)\
**Post date:** [January 25, 2024, 2:30pm UTC](https://community.blaze.today/t/only-allow-one-selection-from-two-data-blaze-tables/35070/3 "2024-01-25T14:30:16Z")

</div>

I tried something like that but it did not work as hoped. I'll try another approach to the if conditions idea.

---

<div class="post-metadata">

**Author:** ![scott](https://community.blaze.today/user_avatar/community.blaze.today/scott/32/30_2.png) [@scott](https://community.blaze.today/u/scott)\
**Post date:** [January 25, 2024, 2:42pm UTC](https://community.blaze.today/t/only-allow-one-selection-from-two-data-blaze-tables/35070/4 "2024-01-25T14:42:44Z")

</div>

Let me know if you have trouble with it. I think it's probably the way to go here.

---

<div class="post-metadata">

**Author:** ![Brad\_Hedinger](https://community.blaze.today/user_avatar/community.blaze.today/brad_hedinger/32/9060_2.png) [@Brad\_Hedinger](https://community.blaze.today/u/Brad_Hedinger)\
**Post date:** [January 27, 2024, 8:00pm UTC](https://community.blaze.today/t/only-allow-one-selection-from-two-data-blaze-tables/35070/5 "2024-01-27T20:00:56Z")

</div>

While it is not the solution the way I was hoping it to be, the {if} condition does work as you suggested and gets us closer.

Select the program this student wishes to change to:

**This list contains ONLY programs available 2/05/2024 and out.**  
{dbselect: SELECT `program name`, `program code`, `start dates`  
FROM Program\_Data  
WHERE `Start Dates` = "2/05/2024 and out"  
OR `program name` = "-"  
ORDER BY `program name`  
ASC; space=id; menu=yes; cols=50; name=program\_selector}

If you need to select an older program, use this list.

**This list contains ONLY programs available BEFORE 2/05/2024.**  
{dbselect: SELECT `program name`, `program code`, `start dates`  
FROM Program\_Data  
WHERE `Start Dates` = "Up to and including 1/08/2024"  
OR `program name` = "-"  
ORDER BY `program name`  
ASC; space=id; menu=yes; cols=50; name=program\_selector}

Selected Program Name: {=program\_selector["program name"]}  
Selected Program Code: {=program\_selector["program code"]}

---

<div class="post-metadata">

**Author:** ![Mansur\_Kutybayev](https://community.blaze.today/user_avatar/community.blaze.today/mansur_kutybayev/32/5897_2.png) [@Mansur\_Kutybayev](https://community.blaze.today/u/Mansur_Kutybayev)\
**Post date:** [January 29, 2024, 6:46am UTC](https://community.blaze.today/t/only-allow-one-selection-from-two-data-blaze-tables/35070/6 "2024-01-29T06:46:06Z")

</div>

I've used the old approach for selecting from 2 formmenus with 1 output. The only problem here is that dbselect as a formmenu can't be updated using variable value change. Therefore I've added additional text to show selected dropdown. This can be further improved it seems - one idea is to load all data from tables into a list and then use it in plain formmenu, that way it should be possible to make formmenus actually reset to "-" state using the old approach.

Select the program this student wishes to change to:

{empty=["program name": "-", "program code": "-", "start dates": "-"]}  
{selector=empty}

This list contains ONLY programs available 2/05/2024 and out.  
{dbselect: SELECT `program name`, `program code`, `start dates`  
FROM Program\_Data  
WHERE `Start Dates` = "2/05/2024 and out"  
OR `program name` = "-"  
ORDER BY `program name`  
ASC; space=id; menu=yes; cols=50; name=new\_program\_selector} {if: selector == new\_program\_selector and selector \<\> empty}(You selected this option){endif}

If you need to select an older program, use this list.

This list contains ONLY programs available BEFORE 2/05/2024.  
{dbselect: SELECT `program name`, `program code`, `start dates`  
FROM Program\_Data  
WHERE `Start Dates` = "Up to and including 1/08/2024"  
OR `program name` = "-"  
ORDER BY `program name`  
ASC; space=id; menu=yes; cols=50; name=old\_program\_selector}{if: selector == old\_program\_selector and selector \<\> empty}(You selected this option){endif}

{if: new\_program\_selector \<\> empty and old\_program\_selector \<\> empty}  
{if: selector == new\_program\_selector}  
{new\_program\_selector=empty}  
{selector=old\_program\_selector}  
{endif}

{if: selector == old\_program\_selector}  
{old\_program\_selector=empty}  
{selector=new\_program\_selector}  
{endif}  
{elseif: new\_program\_selector \<\> empty}  
{selector=new\_program\_selector}  
{elseif: old\_program\_selector \<\> empty}  
{selector=old\_program\_selector}  
{endif}

Selected Program Name: {=selector["program name"]}  
Selected Program Code: {=selector["program code"]}

---

<div class="post-metadata">

**Author:** ![Brad\_Hedinger](https://community.blaze.today/user_avatar/community.blaze.today/brad_hedinger/32/9060_2.png) [@Brad\_Hedinger](https://community.blaze.today/u/Brad_Hedinger)\
**Post date:** [January 29, 2024, 1:50pm UTC](https://community.blaze.today/t/only-allow-one-selection-from-two-data-blaze-tables/35070/7 "2024-01-29T13:50:56Z")

</div>

Yeah my previous solution was the regular formmenu. It worked fine but the DB menu is far superior in so many ways…mostly the ability to type filter in real-time.
