LookupTable

<< Display table of contents >>

Navigation:  Start > Customize templates > Create templates > All template types > Inputs > Basic structure of an input method > Creation rules >

LookupTable

With LookupTable, you create pairs of values that you use to fill fields automatically.

 

A definition for a lookup table has the following format:

LookupTableId: This identifier is used to refer to the lookup table for additional fields.

LookupTable: Value pairs of the table. The assignment is always one-to-one.

 

Example

In the following example, the user selects a company in a drop-down. Depending on the choice, the street, zip code, city are defined.

 

Define value pairs

  "LookupTables": [

    { "Name": "LookupTableStreet", 

      "Definition": {

        "Type": "LookupTable",

        "LookupTableId" : "Street",

        "LookupTable" : {

          "Demo Company Holding": "Demostreet 1",

          "Demo Company Marketing Solutions": "Demostreet 2",

          "Demo Company Services": "Demostreet 3"

        }

      }

    },          

    { "Name": "LookupTableZIPcode", 

      "Definition": {

        "Type": "LookupTable",

        "LookupTableId" : "ZIPcode",

        "LookupTable" : {

          "Demo Company Holding": "10000",

          "Demo Company Marketing Solutions": "20000",

          "Demo Company Services": "90000"

        }               

      }

    },

    { "Name": "LookupTableCity",

      "Definition": {

        "Type": "LookupTable",

        "LookupTableId" : "City",

        "LookupTable" : {

          "Demo Company Holding": "Berlin",

          "Demo Company Marketing Solutions": "Hamburg",

          "Demo Company Services": "Munich"

        }               

      }

    }

  ],

 

Drop down menu and fill the fields

{

  "Name": "company",

  "Definition": {

    "Type": "DropDownList",

    "Items": [

      { "Value": "Demo Company Holding", "DisplayValue": "Demo Company Holding" },

      { "Value": "Demo Company Marketing Solutions", "DisplayValue": "Demo Company Marketing Solutions" },

      { "Value": "Demo Company Services", "DisplayValue": "Demo Company Services" }

    ],

    "Label": "Company"

  }

},

{

  "Name": "streetAddress",

  "Definition": {

    "Type": "TextField",

    "IsEnabled": false,

    "Constraints": {

      "CreationRule": "<lookup>(Street,{company})"

    },                    

    "Label": "Street"

  }

},

{

  "Name": "postalCode",

  "Definition": {

    "Type": "TextField",

    "IsEnabled": false,

    "Constraints": {

      "CreationRule": "<lookup>(ZIPcode,{company})"

    },   

    "Label": "ZIP"

  }

},

{

  "Name": "l",

  "Definition": {

    "Type": "TextField",

    "IsEnabled": false,

    "Constraints": {

      "CreationRule": "<lookup>(City,{company})"

    },   

    "Label": "City"

  }

},