-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integratie van Referentielijsten API #4926
Comments
@stevenbal please draft a plan to implement this before starting to write code :-) |
Configuration (OF backend):
Code changes to selectbox/selectboxes editform (FormIO builder):
Runtime behaviour changes (OF backend):
General:
|
About the format of the data: we could add an option on the components to store labels instead of values, but do note that this might cause logic rules based on this data might not work as well in case of multiple languages, you would have to add a conditional per language, because the labels change per language. Additionally, the current format of the @joeridiederen does that sound reasonable to you? |
Hi @stevenbal ; We had a quick discussion and concluded that storing the value is basically fine, as long as it remains human-readable. And that’s possible, because spaces are accepted. So for your first remark, you don’t need to make any changes; the output will then look like this:
The same is true for the output of the 'selectievakjes' and the 'keuzelijst': the value is stored, not the label. I’ve updated the RFC accordingly. Regarding your second remark: yes, we’d like to add your suggested option to ‘selectievakjes’ to transform the data so it’s immediately understandable for users when they see the value(s). In many cases, the output is meant for humans rather than machines, and we’ve noticed that users find the current format inconvenient. The same goes for ‘keuzelijst’. |
Thema / Theme
Frontend
Omschrijving / Description
This RFC proposes integrating a Referentielijsten API into Open Forms to dynamically populate single-selection (keuzelijst) and multi-selection (selectievakjes) components with values retrieved from external reference lists.
Each time a form is loaded, Open Forms will fetch data from a configured Referentielijsten API endpoint. The fetched list populates selectable options, either as a single-choice dropdown or a multiple-choice checkbox group, depending on the component’s configuration.
The base URL and authentication of the Referentielijsten API is managed within the Open Forms administration interface. However, within each keuzelijst or selectievakjes-component’s settings, an administrator can specify a particular “
code
” (table identifier) to retrieve data for that specific table. This ensures that different components within the same form can request different sets of reference data from the same base URL, simply by varying the tabelcode. Also theisGeldig
boolean should be visible for adminstrators.As a “nice to have,” it would be beneficial if the component’s configuration UI could immediately display a preview of the retrieved data, providing visual confirmation that the correct tabelcode and parameters have been configured
For the keuzelijst (single selection), the user’s chosen label is stored as a string:
For the selectievakjes (multiple selection), the chosen labels are stored as an array:
Added value / Toegevoegde waarde
Integrating the Referentielijsten API to populate keuzelijst and selectievakjes components provides significant benefits. By seamlessly fetching and displaying dynamically maintained reference data, administrators no longer need to manually update static lists. This ensures that forms remain accurate and current over time, especially when tied to official, centrally managed reference lists.
Aanvullende opmerkingen / Additional context
The keuzelijst must support searching, as all options will be loaded at once.
If the API is unavailable or returns an error, Open Forms must display a user-friendly error message to the end user.
Nice to have: the integration must be language-aware*: if the form is presented in a certain language (e.g., Dutch, English), Open Forms should add a query parameter or header to the API call to retrieve language-appropriate labels.
*Not yet possible in the Referentielijsten API, request scheduled for further discussion.
Tasks
Configuration / runtime behavior (OF backend):
Services
to connect with Referentielijsten API. Add a m2m field to GlobalConfiguration to indicate whichServices
areReferentielijsten
instances. #4991Code changes to selectbox/selectboxes editform (FormIO builder):
Referentielijsten API
) on the basic tab (might be good to move to a separate Source tab if the form ends up becoming too complex)code
of the tabel (populated from the tabellen list of the API/api/v1/tabellen
), in parentheses display theeinddatumGeldigheid
(or a boolean if this date is in the past)code
is selected, perform the service fetch operation and display the choices retrieved from/api/v1/items?tabel__code=<code>
openForms.dataSrc
should be set toreferentielijsten
General:
The text was updated successfully, but these errors were encountered: