Forum Discussion

AlexBennett3's avatar
AlexBennett3
Qrew Trainee
4 years ago

Multi-Select Text Formula Help

Hey Everyone,

I wanted to see if I could get some logic advice on a feature I'm trying to add. I have a multi select field with 8 options. I have another field on the same table that shows "Existing" options from the Parent Table. I'm trying to see how I can create something that will remove the "Existing" options from the 8, IF certain criteria is met. That way when the user is selecting the option to add a new option, they can't add one that's already been added before.

Thanks,
Alex

------------------------------
Alex Bennett
------------------------------

4 Replies

  • It's possible to create a multi select formula field to show the unique entries.  There would be a multi select field look up from the parent, a multi select field on the child which is a data entry field and then a final formula multi select field which would have the unique entries.  

    I have this formula wich might work

    var text RawList = List(" ; ",
    ToText([Parent multi select lookup]),
    ToText([Child Multi select]));

    var text A = Trim(Part($RawList,1,";"));

    var text B = If(not Contains($A,Trim(Part($RawList,2,";"))), List("\n", $A, Trim(Part($RawList,2,";"))), $A);

    var text C = If(not Contains($B,Trim(Part($RawList,3,";"))), List("\n", $B, Trim(Part($RawList,3,";"))), $B);

    var text D = If(not Contains($C,Trim(Part($RawList,4,";"))), List("\n", $C, Trim(Part($RawList,4,";"))), $C);

    var text E = If(not Contains($D,Trim(Part($RawList,5,";"))), List("\n", $D, Trim(Part($RawList,5,";"))), $D);

    var text F = If(not Contains($E,Trim(Part($RawList,6,";"))), List("\n", $E, Trim(Part($RawList,6,";"))), $E);

    var text G = If(not Contains($F,Trim(Part($RawList,7,";"))), List("\n", $F, Trim(Part($RawList,7,";"))), $F);

    var text H = If(not Contains($G,Trim(Part($RawList,8,";"))), List("\n", $G, Trim(Part($RawList,8,";"))), $G);

    var text I = If(not Contains($H,Trim(Part($RawList,9,";"))), List("\n", $H, Trim(Part($RawList,9,";"))), $H);

    var text J = If(not Contains($I,Trim(Part($RawList,10,";"))), List("\n", $I, Trim(Part($RawList,10,";"))), $I);

    var text K = If(not Contains($J,Trim(Part($RawList,11,";"))), List("\n", $J, Trim(Part($RawList,11,";"))), $J);

    var text L = If(not Contains($K,Trim(Part($RawList,12,";"))), List("\n", $K, Trim(Part($RawList,12,";"))), $K);

    var text M = If(not Contains($L,Trim(Part($RawList,13,";"))), List("\n", $L, Trim(Part($RawList,13,";"))), $L);

    var text N = If(not Contains($M,Trim(Part($RawList,14,";"))), List("\n", $M, Trim(Part($RawList,14,";"))), $M);

    var text O = If(not Contains($N,Trim(Part($RawList,15,";"))), List("\n", $N, Trim(Part($RawList,15,";"))), $N);

    var text P = If(not Contains($O,Trim(Part($RawList,16,";"))), List("\n", $O, Trim(Part($RawList,16,";"))), $O);

    var text Q = If(not Contains($P,Trim(Part($RawList,17,";"))), List("\n", $P, Trim(Part($RawList,17,";"))), $P);

    var text R = If(not Contains($Q,Trim(Part($RawList,18,";"))), List("\n", $Q, Trim(Part($RawList,18, ";"))), $Q);

    var text S = If(not Contains($R,Trim(Part($RawList,19,";"))), List("\n", $R, Trim(Part($RawList,19,";"))), $R);

    var text T = If(not Contains($S,Trim(Part($RawList,20,";"))), List("\n", $S, Trim(Part($RawList,20,";"))), $S);

    var text U = If(not Contains($T,Trim(Part($RawList,21,";"))), List("\n", $T, Trim(Part($RawList,21,";"))), $T);

    var text V = If(not Contains($U,Trim(Part($RawList,22,";"))), List("\n", $U, Trim(Part($RawList,22,";"))), $U);

    var text W = If(not Contains($V,Trim(Part($RawList,23,";"))), List("\n", $V, Trim(Part($RawList,23,";"))), $V);

    var text X = If(not Contains($W,Trim(Part($RawList,24,";"))), List("\n", $W, Trim(Part($RawList,24,";"))), $W);

    var text Y = If(not Contains($X,Trim(Part($RawList,25,";"))), List("\n", $X, Trim(Part($RawList,25,";"))), $X);

    var text Z = If(not Contains($Y,Trim(Part($RawList,26,";"))), List("\n", $Y, Trim(Part($RawList,26,";"))), $Y);

    $Z

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • AlexBennett3's avatar
      AlexBennett3
      Qrew Trainee
      So with the above code, would I have to change my Parent choices to be designated by Letters? A. Choice One, B. Choice Two, C. Choice Three, etc? I also know that QuickBase is going to no longer be supporting JavaScript in formula fields unless it's within a code page, would this apply to that as well?

      ------------------------------
      Alex Bennett
      ------------------------------
      • AlexBennett3's avatar
        AlexBennett3
        Qrew Trainee
        Can I ask you this, I already have a formula that shows what options are "Existing" and should not be able to be selected if they are trying to add a "new" option. If there is a way to only show options that are NOT Included in this field, then I could use a Dynamic Form Rule to Change my Multi Select field to these options, if they select the type to add new option.

        ------------------------------
        Alex Bennett
        ------------------------------