Introduction
There are times where you will want to ensure that your form uses the same lists as Service (e.g. a list of titles).
This method allows you to make an API call to populate return a list from Service into a select field in a form.
Guide
Step 1: Check that your system has system tokens for "apibrokerKey" and "apibrokerPass". If you don't have these API details they can be created by Firmstep, contact support (or speak to your consultant if Firmstep are working with you on an active project).
Note: getCiviVars does not work with apiKey
Step 2: Create an HTTP Get lookup integration to call the API using the following URL:
https://{host}/apibroker/?key={apibrokerKey}&pass={apibrokerPass}&api=getCiviVars&app_name=AchieveService&var=titles
(Where {host} represents your sitename)
Note: the above API returns a list of titles. To return other values, such as countries, you will need to change the text after var= (see note below with possible parameters).
Step 3: In your HTTP integration, define the path to values and the fields you need from the results:
- Path to values = RepeatableNode
- Fields (in JSON format):
{ "name":"name", "label":"display" }
There are other fields returned but for a lookup field you should just need the name and label returned as "name" and "display".
Step 4: Use the Test Assistant to check that the API is returning a list of values.
Step 5: Add the lookup to a radio, checkbox or select field (and set the 'List Source' to Lookup and selecting the integration you created above).
Notes:
The "var" parameter controls the type of list returned. The possible values are:
- titles
- genders
- preferred_contact_methods
- types
- languages
- statuses
- suffix
- countries
- relationships
Further useful reading:
top of page