Skip to content

surveycto/preload-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pre-load filter

select_multiple Using search box

Description

This field plug-in allows you to dynamically filter a pre-loaded choice list, much like using the selected() function in a choice filter.

This field plug-in is built on the select_one-select_multiple field plug-in, so it has all of the capabilities of that field plug-in. It also has the capabilities of the search-select-one and search-select-multiple field plug-in, so you can enumerators can also use a search box to find the choices they need.

If you have never pre-loaded choices before, check out our documentation on loading multiple-choice options from pre-loaded data, as well as this webinar.

This plug-in is currently under beta. If you you find a problem with the field plug-in, please email support@surveycto.com.

Features

  • Exclude specified choices with exceptions.
  • Only include specified choices, while excluding all others.
  • Optional search box to allow enumerators to find choices more easily.
  • All of the capabilities of the select_one-select_multiple field plug-in.

To learn how to customize the field plug-in, check out the parameters below,.

Data format

Data will be stored in the same format as the original field type. For a select_one field, it will store the value of the selected choice. For a select_multiple field, it will store the values of the selected choices in a space-separated list.

How to use

Getting started

To use this field plug-in as-is, just download the preload-filter.fieldplugin.zip file from this repo, and attach it to your form.

To use with the sample form:

  1. Download the sample form and media files from this repo. The media file includes the data file with the pre-loaded choices.
  2. Download the preload-filter.fieldplugin.zip file from this repo.
  3. Upload the form to your server with the ZIP files attached.

Parameters

All parameters are optional, but they are needed to filter the choices.

Name Description
exclude A space-separated list of choice values that should be excluded. For example, if this parameter has a value of '2 3', then the choices with values of 2 and 3 will not appear in the choice list. All other choices will appear.
include

A space-separated list of choice values that should be included.

If include has a value, but exclude does not, then only the choices listed for the include parameter will be shown, and all other choices will be hidden. For example, if include has a value of '2 3', and exclude is not defined, then only the choices with a value of 2 or 3 will be shown, and all other choices will be hidden.

If both include and exclude have values, then include becomes an exception list to the exclude list. For example, if exclude has a value of '1 3 4', and include has a value of '3', then only choices 1 and 4 will be hidden, and all other choices will be shown; even though choice 3 is in the exclude list, it is also in the include list, so it will still be shown. This can be helpful for choices you always want to appear in a choice list, such as "None of the above" or "Other". It can also help for filtering previously selected choices while keeping the currently selected choice, similar to example 5 here.

search If this parameter has a value of 1, then a search box will appear. The enumerator can use this to search for field labels so they are easier to find.

Default SurveyCTO feature support

Feature / Property Support
Supported field type(s) select_one, select_multiple
Default values Yes
Custom constraint message Yes
Custom required message Yes
Read only Yes
media:image Yes
media:audio Yes
media:video Yes
quick appearance Yes (select_one only)
minimal appearance Yes (select_one only)
compact appearance No
compact-# appearance No
quickcompact appearance No
quickcompact-# appearance No
likert appearance Yes (select_one only)
likert-min appearance Yes* (select_one only)
likert-mid appearance No
label appearance Yes
list-nolabel appearance Yes

*Note: this plug-in works well for the likert-min appearance when the field label is short, and does not contain an image, audio, or video. This is currently a known limitation.

More resources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published