TeamRaiser Goal Achieved Conditional

Options
Hi there, 


I'm trying to create a conditional but having some issues: 

 

Ideally we want this: If goal achieved > 49% but less than 100% show this. 


I'm sure it's easier than i'm making it, but just not able to figure it out.


Hilary
Tagged:

Comments

  • Sounds like a case for E130 again. This tag allows you to do math and logic operations in S-Tags. Pretty much undocumented for us plebes, but here's the thread where Daniel laid it all out.


    https://community.blackbaud.com/forums/viewtopic/1/961?post_id=961#p961


    Something like...


    [[?

    [[S130: [[S48:pct-of-goal]] 49 > ]]::1

    <!--//  Greater than 49% //-->

    ::

    <!--//  Less than or equal to 49% //-->

    ]]


     
  • Hi there, 


    Thanks! That document is helpful. I can get that far, but essentially we want to have something show if they've raised 49-99 and something else show if they've raised 100 or above. So in the case below, i've done this but if you have 101% you will see the message for 49% and above AND 100% and above. 

    [[?
    [[S130: [[S48:pct-of-goal]] 49 > ]]::1
    <!--//  Greater than 49% //-->
    ::
    <!--//  Less than or equal to 49% //-->
    ]]

    [[?

    [[S130: [[S48:pct-of-goal]] 99> ]]::1
    <!--//  Greater than 49% //-->
    ::
    <!--//  Less than or equal to 99% //-->
    ]]


    you mention E130 and S130. Is there one I should be using?



     
  • Oops, yep! The E-tag is really just a special case of an S-Tag. It's used when there are other inner S-Tags that should be Evaluated before the outer S-Tag - so these should be E130, because you need the inner S48 to evaluate first.

    [[?

    [[E130: [[S48:pct-of-goal]] 99> ]]::1

       <!--//  Greater than 99% //-->

    ::

       <!--//  Less than or equal to 99% //-->

    ]]



    You can also nest conditionals, which will address the two messages.

    [[?

    [[E130: [[S48:pct-of-goal]] 48 > ]]::1::

       <!--//  Greater than or equal to 49% - Not done yet //-->
       [[?

       [[E130: [[S48:pct-of-goal]] 99 > ]]::1::

          <!--//  Greater than or equal to 100% //-->

       ::

          <!--//  Greater than or equal to 49% but less than 100% //-->

       ]]

    ::

       <!--//  Less than 49% - Show nothing //-->

    ]]



    Or this is equivelant, if you prefer...


    [[?

    [[E130: [[S48:pct-of-goal]] 49 < ]]::1::

       <!--//  Less than 49% - Show nothing //-->

    ::

       [[?

       [[E130: [[S48:pct-of-goal]] 100 < ]]::1::

          <!--//  Greater than or equal to 49% but less than 100% //-->

       ::

          <!--//  Greater than or equal to 100% //-->

       ]]

    ]]


    I fixed a syntax typo as well, I think this should be pretty close, but I didn't test it.
  • Brian, That's exactly it! Thank you so much! Just in case anyone else is looking for this, we made one slight adjustment to the S48 tag and it worked like a charm. If a blueprint, add 0,. If just a TR, add the TRID: 

    [[?

    [[E130: [[S48:0:pct-of-goal]] 48 > ]]::1::

       <!--//  Greater than or equal to 49% - Not done yet //-->
       [[?

       [[E130: [[S48:0:pct-of-goal]] 99 > ]]::1::

          <!--//  Greater than or equal to 100% //-->

       ::

          <!--//  Greater than or equal to 49% but less than 100% //-->

       ]]

    ::

       <!--//  Less than 49% - Show nothing //-->

    ]]


     
  • Whoops. So close!


    Actually I think the 0 should work in both cases. It's a wildcard for the current TR id. So as long as this code executes in a TR page, the 0 will work.


    The actual tr_id would be necessary if this was NOT hosted on a TR page, such as in an email, for example.

Categories