How to write conditional for multiple groups

Options

I'm having trouble devising the conditional code for something similar to the following:

If email recipient is in group 1111, 2222, 3333 OR 4444 show Thank you for your past participation. If email recipient is in NONE of these groups, show Let me tell you all about this event.

Is there a way to write this or would it be better to combine the above groups into one group?

Thanks!

Shana

--

Shana Masterson

Lead Manger, Online Campaigns

National Brain Tumor Society

Tagged:

Comments

  • That conditional would look like this:



    ]]]]::TRUE::Thank you for your past participation.::Let me tell you all about this event.]]
  • Hi Shana,

    Yes, the implementors use something they call "T" matching when they have to do a complex group conditional like this. Basically the idea is that you have a conditional for each group you are checking for and if the person is in that group then have the conditional print the letter "T", if they aren't then don't print anything at all. Then you wrap all those conditionals in one big one that just checks that any of the conditionals returned a letter "T", if they did then do something, else do something different. I know that is kind of abstract so here is the code which will hopefully make it more clear:

    Conditional framework for checking that someone is in group 2468 OR 3579:

    ]::TRUE::T::]]

    ]::TRUE::T::]]

    ::T::

    Member of at least one of the groups

    ::

    Not a member

    ]]

    Breaking it down:

    ]::TRUE::T::]] <------------ checking if constituent is in group with id# of 2468, if they are then print "T", if not then don't do anything

    ]::TRUE::T::]] <------------ checking if constituent is in group with id# of 3579,  if they are then print "T", if not then don't do anything

    ::T:: <----------- letter to check for if one of the groups returns true.

    Member of at least one of the groups <--------------copy for those constituents who are in at least one of the two groups

    :: <----------- statement separator

    Not a member <--------------copy for those constituents who aren't in any of the groups

    ]] <-------------- closing the overall conditional

    Does that help?

    Ken

  • Noah Cooper:

    That conditional would look like this:



    ]]]]::TRUE::Thank you for your past participation.::Let me tell you all about this event.]]

    Oh right, I overengineered it. Both will work but Noah's is probably faster Shana.

    Good luck!

    Ken

  • Here's the S-Tag documentation for 'Or' Conditionals.


    OR Conditionals

    If the first name is Mary or Misty or Janice, say "There is at least one lady present." Otherwise, say "Neither Mary nor Misty nor Janice is present."

    ]::Mary::T::]]]::Misty::T::]]

    ]::Janice::T::]]::T::Hello Ladies!::Hello]]

    Which I would space like this for clarity...

    ]::Mary::T::]]

    ]::Misty::T::]]

    ]::Janice::T::]]

    ::T::

    Hello Ladies!

    ::

    Hello

    ]]

    The S-Tag for group membership is S45. Put them together and you get...

    ]::TRUE::T::]]

    ]::TRUE::T::]]

    ]::TRUE::T::]]

    ]::TRUE::T::]]

    ::T::

    Thanks you for your participation.

    ::

    Let me tell you about us.

    ]]

    Not tested of course, and also not sure about the S45 tag working in email content. Somewhere to start at least!

    Regards, Brian

  • Brian Mucha:

    Here's the S-Tag documentation for 'Or' Conditionals.


    OR Conditionals

    If the first name is Mary or Misty or Janice, say "There is at least one lady present." Otherwise, say "Neither Mary nor Misty nor Janice is present."

    ]::Mary::T::]]]::Misty::T::]]

    ]::Janice::T::]]::T::Hello Ladies!::Hello]]

    Which I would space like this for clarity...

    ]::Mary::T::]]

    ]::Misty::T::]]

    ]::Janice::T::]]

    ::T::

    Hello Ladies!

    ::

    Hello

    ]]

    The S-Tag for group membership is S45. Put them together and you get...

    ]::TRUE::T::]]

    ]::TRUE::T::]]

    ]::TRUE::T::]]

    ]::TRUE::T::]]

    ::T::

    Thanks you for your participation.

    ::

    Let me tell you about us.

    ]]

    Not tested of course, and also not sure about the S45 tag working in email content. Somewhere to start at least!

    Regards, Brian

    Answers galore!

  • Ken Cantu:

    Hi Shana,

    Yes, the implementors use something they call "T" matching when they have to do a complex group conditional like this. Basically the idea is that you have a conditional for each group you are checking for and if the person is in that group then have the conditional print the letter "T", if they aren't then don't print anything at all. Then you wrap all those conditionals in one big one that just checks that any of the conditionals returned a letter "T", if they did then do something, else do something different. I know that is kind of abstract so here is the code which will hopefully make it more clear:

    Conditional framework for checking that someone is in group 2468 OR 3579:

    ]::TRUE::T::]]

    ]::TRUE::T::]]

    ::T::

    Member of at least one of the groups

    ::

    Not a member

    ]]

    Breaking it down:

    ]::TRUE::T::]] <------------ checking if constituent is in group with id# of 2468, if they are then print "T", if not then don't do anything

    ]::TRUE::T::]] <------------ checking if constituent is in group with id# of 3579,  if they are then print "T", if not then don't do anything

    ::T:: <----------- letter to check for if one of the groups returns true.

    Member of at least one of the groups <--------------copy for those constituents who are in at least one of the two groups

    :: <----------- statement separator

    Not a member <--------------copy for those constituents who aren't in any of the groups

    ]] <-------------- closing the overall conditional

    Does that help?

    Ken

    Hi Noah and Ken,

    I tried to check both answers off as correct, but once I did that for Noah, I could only select Helpful for Ken. Sorry about that. Thanks so much for the quick answers to my question. These things always make me nervous, so it is EXTREMELY HELPFUL to get the info directly from the super smart folks over at Convio! You guys ROCK!

    Shana

  • Brian Mucha:

    Here's the S-Tag documentation for 'Or' Conditionals.


    OR Conditionals

    If the first name is Mary or Misty or Janice, say "There is at least one lady present." Otherwise, say "Neither Mary nor Misty nor Janice is present."

    ]::Mary::T::]]]::Misty::T::]]

    ]::Janice::T::]]::T::Hello Ladies!::Hello]]

    Which I would space like this for clarity...

    ]::Mary::T::]]

    ]::Misty::T::]]

    ]::Janice::T::]]

    ::T::

    Hello Ladies!

    ::

    Hello

    ]]

    The S-Tag for group membership is S45. Put them together and you get...

    ]::TRUE::T::]]

    ]::TRUE::T::]]

    ]::TRUE::T::]]

    ]::TRUE::T::]]

    ::T::

    Thanks you for your participation.

    ::

    Let me tell you about us.

    ]]

    Not tested of course, and also not sure about the S45 tag working in email content. Somewhere to start at least!

    Regards, Brian

    Who knew this was so easy! Thanks, Brian!

Categories