Available in: Axsy Mobile for Salesforce, Axsy Field Service, Axsy Public Sector, Axsy Retail Execution
Lookup Table Elements are a way to access information via a customisable table that takes two inputs and generates a single output value. A Lookup Table needs to be created before you can use it with an element's Default Value Formula to populate an outcome.
Configure the Lookup Table in the Designer
- Under the Designer tab, select the Manage Lookup Tables button to the right.
- Select + Create Lookup and give your new lookup table a Name under the Details tab. Under Column Headers and Row Headers, enter values representing the desired inputs. Separate each value by starting a new line.
NOTE: On saving, the Name will automatically be converted to all-caps, with spaces replaced by an underscore. For example, if you enter 'My Lookup Table', this will save as 'MY_LOOKUP_TABLE'.
- Now you have created the template for your lookup table and you can now fill in the table by selecting the Values tab of the table.
- Fill in the data in the table by clicking on the relevant cell.
- Edit a value by clicking its cell.
NOTE: You cannot edit the values of the Column and Row Headers under the Values Tab. To make changes to these, navigate back to the Details tab of your table.
Configure the Element's Default Value Formula
Now that te table is complete, you can use it with an Element's Default Value Formula to lookup the outcome of two Elements that match the values of a Lookup Table's Column and Row Headers:
- Create three Elements.
- The Element that comes first in the formula will search for a match in the Columns of the lookup table. The Element that comes second in the formula will search for a match in the Rows of the lookup table.
- Add this formula under the Defaults tab of the third Element: TABLE_NAME(Element1, Element2)
Example: When you run the Smart Form on the Axsy Mobile App, if 'Element1' and 'Element2' are given the values Paper and Scissors, the Default Value of 'Element3' will be Scissors Wins (referencing cell highlighted in Step 3).
NOTE: If the value provided for either ROW or COLUMN does not find a match in the table, the formula will return an empty value.
Hardcode the Column or Row
Rather than having an Element's value be used as the input to a row or column, you can also hardcode one of the values in the formula to a value of your choice.
Example: Instead of the formula TABLE_Name(Element1, Element2) , you could hardcode the column value to be "Rock". The formula would then look like TABLE_NAME("Rock", Element2).
NOTE: When referencing the hardcoded value, remember to use either double or single speech marks to encapsulate it.