Jump to content
  • 0

Is there a way to show in a dropdown multiple fields from a source table to make selections easier | populate another field based on the value in a different field


RossChevalier

Question

Hello,

Two questions, probably dumb but I am still new to CASPIO

I am using List String and List Number data types in tables and populating the options from the contents of other tables.  This works nicely.

What I would like to do is the following with an example.

The Employee table field DeptCode is a ListNumber sourced from table Dept.  The dropdown on the Employee Creation form shows the list of possible departments which is great, but I would like the dropdown to show the department number (as it does) but also show the department name value for that record in the Dept table.  This will make it easier for creators to pick the correct department.

I also have a field in Employee DeptName which is a ListString type also sourced from table Dept.  I would like to know how to automatically load the proper department name based on the department number.  I need to store them as separate items for reporting but would like to automate the load of department name based on its department number.

As a tertiary question, in this scenario, a user can select more than one department number and I would like to make this selection forced to be a single choice.  I am sure that I have missed a setting in this regard.

Thanks in advance.

Ross

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hey there @RossChevalier :)

List data types are designed to accept multiple values. A user Can select just one option, but they Can also choose more than one. Not sure if any script will work for enforcing the field to just accept one choice. You can learn more about that data type here.

Depending on your workflow and why you needed to use a list data type, an alternative I can suggest is to use a text 255 data type for these fields instead. It's kinda ideal since if you use it in a submission form, set the form element to a dropdown, it will only accept one value. Plus, since you mentioned you have a table where the choices are coming from, you can use this as a lookup table or table where you will be getting the choices from for your dropdown.

 image.png.1bcbe5565783eba2993b1b5c37c54294.png

Good thing is, when you use a text data type, you can now use it as a parent field for cascading form elements whereas list data types cannot be used as parent fields for this. This will be useful for your second question where the DeptName will be automatically pulled up based on the Department Number.  You can check this sample DataPage I created for you ->  https://c2abn197.caspio.com/dp/adf58000bdb28da708494616b1c6

Now for your first question where you can see both the Department number and name, I do not think that's possible as of now. Maybe some type of script too. But if you want a more standard approach, you can choose to show the department name as the display values, but still save the department number of that record. 

image.png.a1435365a4339ff8cd2fd68736c42dd2.png

 

I hope this somehow gives you an idea :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...