JSON Select List Field

Categories

Component ID

2434715

Component name

JSON Select List Field

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

The JSON Select List Field module allows you to generate the option name/value pairs for a select dropdown list from an external source that is returning JSON data. An example use-case for this module is where there is a legacy look-up table that you want to synchronize with data in Drupal. This use-case also called for 3 additional components 1) a complimentary module which reposted field data to an external script whenever a field of this type was created or edited 2) a simple php script that queried the legacy system's lookup table and converted the result to JSON (in this first implementation it was a DB2 database) 3) a simple php script to write the data posted to it from drupal to the database.

Caching is implemented by default with this module so as to not tax the external source. Keep this in mind if you are testing or need up-to-the-second data synchronization.

Warnings - by default the string length assigned in the database is 55. If you are working with longer strings you will need to increase that. The schema used for this mimics a text field not a select field. Currently it only saves the option value in the database and you cannot get the option name within drupal. With a true drupal field of type "list" you can look up the option name from the value by looking at the allowed option values.

In the most basic form this module allow content type administrators to maintain Select Options in an external system.