Example of a Complex Custom Variable

A complex custom variable is a lookup table that is used to find a value by matching a row value and a column value.

The project has a form "Fuel Consumption" form. The form includes a calculation question that uses a fuel consumption number as part of the calculation. That number is determined by the type of fuel used and the type of vehicle driven.

To achieve this, a custom variable called "CO2 Vehicle Lookup" could include four columns to which multiple rows can be added:
Fuel Type Automobile Van Truck
Diesel 35 60 110
Gasoline 30 50 100
Propane 10 30 60

To retrieve a single value from this custom variable, the following questions are add to a form:

  • What fuel is your vehicle using?
  • What vehicle are you driving?

If the answers were Diesel and Truck, the retrieved value is "110". This retrieved value can then be used to populate a text or numeric question type as a default answer, or it can be used as part of a calculation question within the form.