How to change the options of a kintone dropdown?

I have a kintone table on the Detail Edit page.

Inside the table, I have a dropdown field named “travel_type”.

I want to programmatically populate the options of the dropdown based on the value of a variable “service_type”.

If “service_type” = “Service Estimate”, I want the dropdown to be filled in with “N/A”, “Drive” and “Fly” options.

If “service_type” = “Service Quote”, I want the dropdown to be filled in with the “N/A” option.

How to accomplish this?

Hi annaylee,

There are a couple of ways to do this.

You can use the kintone UI Component, or it is possible to create a dropdown list using jQuery or the document.createElement() method, but it takes time and effort, and the appearance is generic HTML rather than the kintone look that the kintone UI Component can do.

Please check below for more information;

kintone-ui-component Versions:

https://kintone-labs.github.io/kintone-ui-component/latest/versions/

Table:

https://kintone-labs.github.io/kintone-ui-component/latest/Reference/Table/

FYI, a similar process can be done with the native feature.

  • Create a master app for the options, lookup in the “service_type” field, and copy the “travel_type” field.

  • Combine into one dropdown field

Hopefully, this helps.

1 Like

Hi Sean,

Thank you for the info.

Is the native way the best of all 3 ways to do this?

Can you please provide me with more details about the native way of implementing this?

I am not sure how to use a lookup to retrieve values from another app to populate a dropdown.

so far I have been using lookups to retrieve values from another app to populate text fields, but not dropdowns.

Thank you very much. 

//

FYI, a similar process can be done with the native feature.

 

・Create a master app for the options, lookup in the “service_type” field, and copy the “travel_type” field.

・Combine into one dropdown field

Hi annaylee,

You are very welcome!

I think some misunderstandings and miscommunications are happening.

I apologize for that.

One way is to utilize the “kintone UI Component,” which I think would be the best fit for your inquiry since it allows you to create “dynamic” dropdowns that match the look and feel of kintone.

The second is troublesome, but a possible way is by using jQuery or the document.createElement() method and the appearance is generic.

The following two options/process can be achieved via native features;

・Create a master app for the options, lookup in the “service_type” field, and copy the “travel_type” field.

-a master app with two text fields, “service_type” & “travel_type,” within a table, four records added for the options. “Service Estimate” with “N/A,” “Drive,” and “Fly” & “Service Quote” with “N/A.”

Then, look up the master app with the configuration of the data source app being the master app and the “travel_type” field for field mappings.

・Combine into one dropdown field

-most simple one would be to have a dropdown field within a table with the service/travel type combined and have a total of four options;

・Service Estimate (N/A)

・Service Estimate (Drive)

・Service Estimate (Fly)

・Service Quote(N/A)

>I am not sure how to use a lookup to retrieve values from another app to populate a dropdown.

>so far I have been using lookups to retrieve values from another app to populate text fields, but not dropdowns.

Your understanding is correct, and dropdown fields can not be specified as a key but only be specified for field mappings.

Sorry for the confusion.

Hopefully, this clears all the misunderstandings, and you can find a way to fulfill your needs.

1 Like