Solved

Displaying a list in a drop-down

  • 10 March 2023
  • 6 replies
  • 81 views

Userlevel 1
Badge +1
  • Data Voyager
  • 4 replies

Hi,

   How do I present a selection of values in a drop-down in the RDM create/edit screens.

E.g. I have an entity called Door with a column called state that can have a value of either Open or Closed. Can this be presented as a drop down to a user?

baz

icon

Best answer by Ojaswini 16 March 2023, 11:33

View original

6 replies

Userlevel 2
Badge +5

If I am understanding the question correctly, you are talking about some parent child relationship where one column values in child table, should come from predefined values from master table. You can use Drop Down capabilities for that column in child table. you need to mention this in the Relationships of parent -child table. You can choose combo or window.

 

I hope this will resolve your issue.

Userlevel 1
Badge +1

Hi - I was hoping to find a way to present a drop down list without having to create an additional table. Returning to my original example of the Door and its State attribute, I want to avoid creating a Door_State table with just two values and a relationship between it and the Door table.

 

 

Userlevel 5
Badge +4

Hi Baz,

 

At the moment the only solution for drop down is to create a separate table which will act as parent table to your Door table.

A way around it is to create an expression validation in that table, only allowing those 2 values, and putting that also in the error message to let the users know that these are the only 2 values allowed.

But this means, if you need to add to the allowed values in the future you will need to do a model change.

 

We have seen similar use case implemented with a generic “picklist” table, with columns “table_name” and “value”, so e.g.

table_name value
Door Open
Door Closed

 

 

Then at your Door table, you relationship would use picklist table as a parent, and use filter table_name = ‘Door’

So you can have all of these little “bits” of ref codes in a generic picklist table and you won’t need to create loads of them.

What do you think? Would this work for you?

Userlevel 2
Badge +1

@MayKwok for your basic table example. Is there a way to manually type into the table? Or would a load plan still be needed for these two entries?

Userlevel 2
Badge +1

@MayKwok for your basic table example. Is there a way to manually type into the table? Or would a load plan still be needed for these two entries?

After talking with a coworker, found there is not, and that best practice is to create a plan with a load file into the table.

Userlevel 6
Badge +7

Hi @Jason.Suptic, thank you for coming back here and sharing your experience with the community, appreciate it 🙌

Reply