User:Jatin.me/SF-Defining Forms/Autocompleting on outside values

Autocompletion from outside URL
To have a field autocomplete on values from outside the wiki, take the following steps:

1. Create a page/web service that takes in a substring via the query string, and displays a set of autocompletion values; the values should be in JSON format, and look like the JSON returned by the MediaWiki API (see here for an example). This also makes it easy to autocomplete on the values from another wiki.

2. Decide on a short string to represent this URL.

3. Add a line to LocalSettings.php that looks like this: The URL in this line should look like a call to that web service, but with the substring replaced by the string " ".

4. Add the parameter "values from url=URL-identifier-string" to the relevant field in the form definition.

Autocompletion using External Data extension
This allows displaying additional data like thumbnail images, description text along with the title text for autocompletion in a field. For autocompletion using ED extension you need to first call any of the parser functions of ED in the form definition(usually at the bottom of the form definition) to fetch data from the external/internal source. See retrieving data using External Data.

This is a sample calling to #get_web_data parser function of ED to fetch data from some external/internal source: Now, use the field definition as below to be able to use the values retrieved from the URL for autocompletion: