Using list values in formulas





(This feature is supported on version 1.11 and higher of the add-on)

Use case

Assume that you want to create  a grid to enter line items on a quote (for instance to quote expensive cars)
The grid should allow the user to select from a drop down list a product, price and description are automatically set:
A total is calculated once that a unit is set 

Grid configuration

The custom field itself can be configured as follows

##### # Define main grid parameters such as columns and where the table must be stored #   gd.columns = product, idescription, price, unit, total gd.ds = jira gd.tablename = carquote   ##### # The product is a dynamic list, containing the product, the price and the description # Note that the id is added for references purpose col.product = Product col.product.type = list col.product.query = select product, id, price, idescription from products_d4 col.product.query.ds = jira col.product.width = 400   ##### # The price is retrieved from the product list (the price attribute) # col.price = Price col.price.type = number col.price.formula = {product.price} col.price.width = 100 ##### # The description is retrieved from the product list (the description attribute) # note that the description is declared as a string, and that only the first 255 chars will be displayed # (textarea's have no formula support) col.idescription = Description col.idescription.type = string col.idescription.formula = {product.idescription}   #### # The unit is just a plain integer field, which can be entered by the user # col.unit = Unit col.unit.type = integer col.unit.minValue = 1 col.unit.maxValue = 4 col.unit.width = 100   #### # The total is calculated from the unit and the price. # Note {price} references the value of the price column, while {product.price} references the value of the price attribute of the selected product. # col.total = Total col.total.type = number col.total.formula = {price} * {unit} col.total.width = 100

Driving table configuration

Although not strictly necessary  for this use case, you can use JIRA to host the driving table containing all the products the user can choose from.
  

Check the driving table configuration example

  gd.columns = product, price, idescription gd.ds = jira gd.tablename = products   col.product = Product col.product.type = string col.product.required = true col.product.width = 200   col.price = Price col.price.type = number col.idescription = Description col.idescription.type = textarea col.idescription.rows = 5 col.idescription.cols = 50