Skip to main content
Question

Combine two multi-select fields

  • June 28, 2018
  • 0 replies
  • 149 views

I have set up a formula field to combine two multi-select fields into a using the list function. It looks like this: 
List(";", [Select1], [Select2])

At a basic level, this works fine. However, Select1 and Select 2 frequently end up having intersecting values. This is a problem for my formula. For example if: 
Select1= A;B;D
Select2=A;C;E
the formula would output: A;A;B;C;D;E

I should note that the number of selections for each field is not constant, and can be pretty much as large as the user wants. 

Is there a way to fix this?

  • Quickbase Alumni
  • June 29, 2018
What are you trying to combine them into?  A text value?  

And, in your example, what are you expecting the result to be?

Thanks,

~Rob

You will need to first break up [Select 2] into its parts.

var text PartOne = Part([Select 2],1,";");
var text PartTwo= Part([Select 2],=2,";");

etc etc etc

var text PartTwenty = Part([Select 2],20,";");



var text StepOne =
  List(";", [Select 1], IF(not Contains([Select 1], $PartOne), $PartOne);

var text StepTwo = 
  List(";", $StepOne, IF(not Contains($StepOne, $PartTwo), $PartTwo);

var text StepThree = 
  List(";", $StepTwo, IF(not Contains($StepTwo, $PartThree, $PartThree);

etc etc etc

var text StepTwenty = 
  List(";", $StepNineteen, IF(not Contains($StepNineteen, $PartTwenty, $PartTwenty);



$StepTwenty