Multiply select boxes based on value in a database

I have a listitem which i need to take the information from a database table. As well as taking the information i need to add multiply select boxes based on a number in another table.

Hey @Daniel_Donnelly!

There are some good examples of how to build List Views in these docs, is that something you're already taking a look at? It sounds like you might want to do a join between the two tables so that you can have the data together in one query making it easier to use nested List Views - are the tables in the same database?

Yeah i've had a look through them. It's not quite want am after.

I've got the listview/dropdown box showing the information i want.

I'll try to explain differently.
In one of the database tables i have a column heading no_staff. The values are either 1 or 2.

In the listview there are 2 dropdown boxes. What i need to happen is if the column value is 1 the dropdown box2 needs to be set to hidden=true and if the value is 2 then dropdown box2 needs to be set to hidden=false.

The no_staff cloumn is in the same table as the person name that is also displayed in the listview

Hipe this explains a little bit better.

Hmm... that makes sense. I'm not sure I have it right but you might want to try something like {{ yourTable.data[i].no_staff == 1 }} in the hidden field of dropdown box 2. If that doesn't work, would you mind sharing some screenshots of your setup?

How does this get the name from the listView as there would be multiple cards in the listview which would return different values for the number of staff (1or 2).

Would it be easier to give you access to the app to have a look

When you reference the variable i in a component that's within a listview it becomes a reference to that component's index:

You can use that to access any property in a table's row:

If you have this question there's a good chance other people do as well so any context you can share publicly can be really helpful. That being said, if you're using a cloud org we can step in a take a look as long as you're using the same email on the forums and give us permission, or if you don't mind sharing you're subdomain with us :slightly_smiling_face:

If you want to read more about list views there's also some good documentation here!

Hi Kabirdas. Yeah am still abit confused on how to get this to work. Am using the same email address for the app. The domain for this daniel.donnelly.retool.com/mobile/editor/lagan's%20foundation.

The select box in question is in the Staff Schedule section and is select6. I have some data if you filter the date to 31/07/2023.

Ah sorry about the confusion here @Daniel_Donnelly I had moved away from database tables to the table component and you aren't even using the desktop version :sweat:

In your case, you might try using {{yourQuery.data.no_staff[i] == 1}}. The main thing here is to reference the query that has your table data in it. Furthermore, since SQL queries return data a bit differently, you'll want to move the [i] index to the end of the expression:

Let me know if that works!

Evening Kabirdas.
That's worked. Thank you very much.