Generate ListBox from ListBox result

Hi,

Metabase Version : v0.48.2
Jar Version

In a dashboard i tried to generate a listebox from a listbox result.

Example :
1 - In the forst ListBox, i select an APPLICATION_NAME
2 - The field selected in the first ListBox generate the fileds in the second ListBox that contain the DATABASE NAME used by the APPLICATION selected.

Do you know if it's possible to do that ?
Thanks for your help,
Matt

Have you checked out Linking filters in dashboards?

Hi,

Thanks for your reply.

I saw this option to link the listbox. But i don't how it works.

I have three tables like below :

CREATE TABLE DATABASE
(
    dbid        NUMBER NOT NULL,
    db_name     VARCHAR2(8) NOT NULL, 
    db_link     VARCHAR2(35) NOT NULL, 
    CONSTRAINT DATABASE_PK PRIMARY KEY   (dbid)  ENABLE 
);

CREATE TABLE APPLICATION_SI(
    NUM_APPLICATION         NUMBER  GENERATED ALWAYS AS IDENTITY,
    NOM_APPLICATION         VARCHAR2(60) NOT NULL,
    DESC_APPLICATION        VARCHAR2(300),
    MATRICULE               NUMBER NOT NULL,
    CONSTRAINT C_APPLICATION_SI_PK PRIMARY KEY   (NUM_APPLICATION)  ENABLE,
    CONSTRAINT MATRICULE FOREIGN KEY (MATRICULE) REFERENCES REFERENT (MATRICULE)
);

CREATE TABLE SCHEMA_USER(
    NUM_SCHEMA              NUMBER NOT NULL,
    USERNAME                VARCHAR2(30),first
    DBID                    NUMBER NOT NULL,
    NUM_APPLICATION         NUMBER NULL,
    CONSTRAINT C_SCHEMA_USER_PK PRIMARY KEY   (NUM_SCHEMA)  ENABLE,
    CONSTRAINT C_SCHEMA_USER_FK_DBID FOREIGN KEY (DBID) REFERENCES DATABASE (DBID),
    CONSTRAINT C_SCHEMA_USER_FK_NUM_APPLICATION FOREIGN KEY (NUM_APPLICATION) REFERENCES APPLICATION_SI (NUM_APPLICATION)
);

I have the first query for complete the first ListBox which list the Application :

SELECT APP.NOM_APPLICATION,REF.NOM_REFERENT, REF.PRENOM_REFERENT
FROM APPLICATION_SI APP
INNER JOIN REFERENT REF ON APP.MATRICULE = REF.MATRICULE

And the second query to complete the second ListBox with the field select in the first ListBox. This query list the Application has got a user in a Database :

SELECT  DB.DB_NAME
FROM DATABASE DB
INNER JOIN SCHEMA_USER USR ON DB.DBID = USR.DBID
INNER JOIN APPLICATION_SI APP ON USR.NUM_APPLICATION = APP.NUM_APPLICATION
WHERE APP.NOM_APPLICATION = {{APPLICATION_NAME}}

Do you know if it's possible ?

Thanks,

Matt

I

You need to use GUI questions instead of sql questions for this to work

Hi,

Thanks for your reply.

I created a simple question link database and schema_user table like below :slight_smile:

After in my dashboard i configure the first ListBox to display db_name :
LISTEBOX_1

And confiure the second to link with the first to select username :

LISTBOX_2_CONF_02

But when i select a database in th second i can't select the username :
TEST

I don't know what i done wrong.
Thanks for your help,
Matthieu

Hi,

I'am starting from the begining and follow this article [Linking filters in dashboards].

I installed a Metabase test with the [Sample Data].

I configure the question as it is written.

I configure a dashboard like this :

Listbox State :

Listbox City :

But when i select a State the City Listbox is empty.

Do you know what i forgot ?

Thanks for your help,
Matt

Hi,

In fact it work but the city ListBox is a Completion textbox.

01
02

How can i get a ListBox City from the selected State ?

Thanks,
Matthieu