Forum Discussion

Ma__IsabelGuman's avatar
Ma__IsabelGuman
Qrew Cadet
5 years ago

Formula-User field that shows value of another Nonempty user field

#field#Formulaandfunctions 
Hi. I have a formula user field FINAL USER that should show the User A if "User A" field is nonempty, else it should show User B, but if User B field is empty, it should show User C. If User C is empty, it should finally show User D. If I have this: If ( IsNull ([User A]), [User B],[User A]), then it works. However, I need to be able to have the conditions below in that FINAL USER field. Can you please help with the formula?


If(
IsNull([User A]), [User B],[User A],
IsNull([User B]), [User C],[User B],
IsNull([User C]), [User D],[User C]
)

​​​

------------------------------
Isabel Gumanid
------------------------------

5 Replies

  • Try this formula.  You may want to put  a default user at the end, in case [User D] is also blank.

    If(
    IsNull([User A]) = false, [User A],
    IsNull([User B]) = false, [User B],
    IsNull([User C]) = false, [User C],
    IsNull([User D]) = false, [User D]
    )

    ------------------------------
    Xavier Fan
    Quick Base Solution Provider
    http://xavierfanconsulting.com/
    ------------------------------
    • Ma__IsabelGuman's avatar
      Ma__IsabelGuman
      Qrew Cadet
      Thank you! Will try this one. Appreciate your help.

      ------------------------------
      Ma. Isabel Gumanid
      ------------------------------
      • XavierFan's avatar
        XavierFan
        Qrew Cadet
        (for some reason - I encountered an error when trying to reply to your message)

        Ok - if you want to check [User A] against some email, try this formula:

        If(
        IsNull([User A]) = false and UserToEmail([User A]) <> "supervisor@gmail.com", [User A],
        IsNull([User B]) = false, [User B],
        IsNull([User C]) = false, [User C],
        IsNull([User D]) = false, [User D]
        )

        The UserNameToEmail changes the User into the email it corresponds to, and you compare that with the email that you have.

        Then the rest of the formula is the same.  Hope this helps!

        ------------------------------
        Xavier Fan
        Quick Base Solution Provider
        http://xavierfanconsulting.com/
        ------------------------------
  • This version worked for me in a test app:
    Case(not true,IsNull([User A]),[User A],IsNull([User B]),[User B],IsNull([User C]),[User C],[User D])

    ------------------------------
    Eric Mohlman
    ------------------------------
  • Isabel,

    It looks like your response was sent privately, so others can't see the update. Here it is in case anyone wants the context:
     I forgot to mention which will only apply to User A. It should be "If User A is not empty and not equal to supervisor@gmail.com, then show User A". Any thoughts?​
    To accomplish that, I would use this type of formula:
    If(not IsNull([User A]) and UserToEmail([User A])<>"supervisor@gmail.com",[User A],Case(not true,IsNull([User B]),[User B],IsNull([User C]),[User C],[User D])

    ------------------------------
    Eric Mohlman
    ------------------------------