Assigning and summing values to multi-select items.

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

How would I create a field that would assign different prices based on what was selected in a multi-select text field? I am looking to also sum the total up in this new field.

For instance, I have a multi-select field of different types of services. I would like to have an additional field that assigns different prices to the services and totals the values to what was selected in the multi-select field.


Any help would be appreciated.

Photo of Wayne

Wayne

  • 0 Points

Posted 3 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,760 Points 50k badge 2x thumb
The formula to do whatb you want would lok like this

var text Fruit = ToText([Multi select]);


If(Contains($Fruit,"apples"), [Apple price],0)


+

If(Contains($Fruit,"peaches"), [Peach price], 0)

+

If(Contains($Fruit,"pears"), [Pear price],0)



You will want a setup using snapshot fields so that when you change the standard price for your services, the historical prices on previous orders does not change.  But that is probably a different Q & A.  
Photo of Wayne

Wayne

  • 0 Points
Thanks this worked!