Forum Discussion

RossonLong1's avatar
RossonLong1
Qrew Cadet
4 years ago

Filtering User List Formulas

Hi! I am trying to find a way to filter a user list.

Fields:
User (single user field)
User-List (multiple users field)
Filtered User-List (multiple users field)

Example:
User has:
U1

User-List has:
U1;U2;U3

Goal:
Filtered User-List has:
U2;U3

Problem:
I've tried stuff like
ToUserList(
Left([User-List],[User])
Right([User-List],[User])
)

But User-Lists don't have the same rules as normal text fields and therefor I can't modify them like I would a text field. I also can't figure out a way to turn them into text fields, filter them, and then back into QuickBase Users. (If that's even possible).

Any thoughts on how to filter these User-Lists in the way I presented above?

------------------------------
Rosson Long
------------------------------

3 Replies

  • try this

    var user UserField = [User]; // set the user field
    var userlist MyUserlist = [Userlist]; // set the Userlist field

    ToUserList(
    If(ToUser(Part(ToText($MyUserlist),1,";")) <> $UserField, ToUser(Part(ToText($MyUserlist),1,";"))),
    If(ToUser(Part(ToText($MyUserlist),2,";")) <> $UserField, ToUser(Part(ToText($MyUserlist),2,";"))),
    If(ToUser(Part(ToText($MyUserlist),3,";")) <> $UserField, ToUser(Part(ToText($MyUserlist),3,";"))),
    If(ToUser(Part(ToText($MyUserlist),4,";")) <> $UserField, ToUser(Part(ToText($MyUserlist),4,";"))),
    If(ToUser(Part(ToText($MyUserlist),5,";")) <> $UserField, ToUser(Part(ToText($MyUserlist),5,";"))),
    If(ToUser(Part(ToText($MyUserlist),6,";")) <> $UserField, ToUser(Part(ToText($MyUserlist),6,";"))),
    If(ToUser(Part(ToText($MyUserlist),7,";")) <> $UserField, ToUser(Part(ToText($MyUserlist),7,";"))),
    If(ToUser(Part(ToText($MyUserlist),8,";")) <> $UserField, ToUser(Part(ToText($MyUserlist),8,";"))),
    If(ToUser(Part(ToText($MyUserlist),9,";")) <> $UserField, ToUser(Part(ToText($MyUserlist),9,";"))),
    If(ToUser(Part(ToText($MyUserlist),10,";")) <> $UserField, ToUser(Part(ToText($MyUserlist),10,";")))
    )

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • RossonLong1's avatar
      RossonLong1
      Qrew Cadet
      Got it, so a one-by-one check and insert. I guess since the limit is 20 people in a single user-list field this should be fine to implement.

      ------------------------------
      Rosson Long
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew Champion
        Right, you can keep the pattern going until you get to 20 parts.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------