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"]}
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?
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"]}
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:
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}
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.