Forum Discussion

Kelly-AnnTainto's avatar
Kelly-AnnTainto
Qrew Cadet
20 days ago
Solved

If Then Else formula with a multi select field.

Help Please.   I have a multi-select field that has the options of Mail, Email and Dept to Initiate.  Mail and Email can both be options.  In that case, I want it to display "Mail and Email".  But if just mail, "Mail, if just email, "email", etc.  However I can't seem to get it work correctly.  it does show both.  Then will show just Mail, but when Email is selected it still shows Mail.  I've looked at this so long and tried to refigure it that at this point is probably glaringly obvious, but I just can't see it.   

This is the current formula I have:

var text Receipt=If(Contains(ToText([License Master - Renewals Received via:]),"Mail, Email")=true, "Mail and Email", Contains(ToText([Renewals Received via:]),"Mail, Email")=true,"Mail and Email", Contains(ToText([License Master - Renewals Received via:]),"Mail"), "Mail", Contains(ToText([Renewals Received via:]),"Mail"), "Mail", Contains(ToText([License Master - Renewals Received via:]),"Email"), "Email", Contains(ToText([Renewals Received via:]),"Email"), "Email", Contains(ToText([License Master - Renewals Received via:]),"Dept to initiate"), "Dept. to Initiate", Contains(ToText([Renewals Received via:]),"Dept to initiate"), "Dept. to Initiate");

"<span style='font-size:18px;color:#1E90FF;white-space:nowrap'><b>"&$Receipt&"</b></span><br>";

  • Kelly-AnnTainto's avatar
    Kelly-AnnTainto
    20 days ago

    After I wrote my last response and re-read yours, I realized I made this way overcomplicated.  There is a VERY simple way to do what I'm trying to do.   

    If(ToText([License Master - Renewals Received via:])="",ToText([Renewals Received via:]),ToText([License Master - Renewals Received via:]));

    Yikes.  Thanks for your help. 

     

  • I went a bit crosses eyed trying to look at your formula, but it seems to me that you simply want to list whatever options the user selected separated by " and ", is that right?

     

    If that is the case, try this

    var text Receipt =

     SearchAndReplace(ToText([License Master - Renewals Received via:]), " ; ", " and ");

    "<span style='font-size:18px;color:#1E90FF;white-space:nowrap'><b>"&$Receipt&"</b></span><br>";

     

    note that its possible that the confusiton that to were having is that the phrase email contains the word mail 

    so both email and mail contain mail.

     

     

     

    • Kelly-AnnTainto's avatar
      Kelly-AnnTainto
      Qrew Cadet

      After I wrote my last response and re-read yours, I realized I made this way overcomplicated.  There is a VERY simple way to do what I'm trying to do.   

      If(ToText([License Master - Renewals Received via:])="",ToText([Renewals Received via:]),ToText([License Master - Renewals Received via:]));

      Yikes.  Thanks for your help.