Is it possible to fill a dropdown in one app with valid values from another app? So that, when the user adds a new record to App 1, the selections in the dropdown are populated with values from another app? This would keep people form having to update the other app, then go back to the first app and edit the dropdown selections.
I would prefer a Lookup field to a dropdown, but this field needs to be populated via the API, and it looks like you can’t use the API to populate Lookup fields. Has that changed?
Hello James
You can do it by either of the following:
-
App to Setup the Choices < Obtain - “Dropdown” Field
-
App to Setup the Choices - Reflect > “Dropdown” Field
In the case of 1.
- Place a Text field
- Use the Record Create/Edit events to run the step 3 process and after that
- Hide the text field
- Use the GET record API to obtain records of an app that you set up the choices
- Using the data obtained in step 4), display your original dropdown field
- Using the record add/edit save submit event, reflect the value chosen in the original dropdown field to the text field
OR
In the case of 2.
- Using the GET record API or the kintone.app.record.get(), obtain records of an app that you set up the choices
- Based on the record obtained in step 1), create a request to change the choices of the “Drop-down” field
- Using the request in step 2), run the API that changes the field settings
- To reflect the changes made in step 3), run the API that applies the changes to the app environment.
Reference:
Kintone Developer Program - Kintone REST API List
https://developer.kintone.io/hc/en-us/articles/360008719854-Kintone-REST-API-List
I hope this helps
By the way, regarding the lookup field that you mentioned, if you are talking about using the add record “POST” to add the lookup field, it is possible to add it if you set up the data source map’s key field to “prohibit duplicate values.”