0

Body of Email field

Hello,

Is it possible to add logic within the body of an email field?

 

For instance I am creating an email body with fields from my view, but some I only want to show if another field is ticked

Thanks

 

David

7 replies

null
    • Fred
    • 1 yr ago
    • Reported - view

    If PPC is a yes/no field and you want check if it is set to yes, then you can do something like:

    if PPC then {'Google Date Studio Link'} end
    

    For a yes/no field just by putting the name of the field tells Ninox to validate only when true or yes or 1.

    If PPC is a choice field then you will need to know the number of the choice you want selected. So if the selection is number 2 on the choice list then:

    if PPC = 2 then {'Google Date Studio Link'} end
    

    If you want to use the text that is in your choice field:

    if text(PPC) = "apple" then {'Google Date Studio Link'} end
    
    • david.6
    • 1 yr ago
    • Reported - view

    Hi Friend,

     

    Thanks for the above answer. Is this possible within the body of the email field? I assume it would just literally print out the words "if ppc then"

    • Fred
    • 1 yr ago
    • Reported - view

    When I tested it, it knew code from text. 
     

    What is your experience?

    • david.6
    • 1 yr ago
    • Reported - view

    I have the following in the body of my email

    if {'Is PPC to be included in report'} then {'Google Data Studio Link'} end

    And the output in the actual email is

    if Yes then https://datastudio.google.com/reporting/XXX end

    The field ''Is PPC to be included in report' is a Yes/No toggle field, I've tried the IF without the parentheses and just quotes etc but still no luck 

      • John_Halls
      • 1 yr ago
      • Reported - view

      david You can see that everything inside the curly brackets is being evaluated, and everything outside is being treated literally.

      By way of an example, if I were running a holiday home business my email to the holiday maker prior to arrival might look like this

      Dear {FirstName}
      Thank you for booking {HolidayHome}. We are looking forward to seeing you on {StartDate}.
      You will be allowed in from {if IsPets then "3pm" else "2pm" end}.
      The entry code is {EntryCode}.
      Yours etc...
      

      Regards

      John

    • Fred
    • 1 yr ago
    • Reported - view

    Looking back at my code Ninox changed it so you can try:

    {if 'Is PPC to be included in report' then ‘Google Data Studio Link' end}

    • david.6
    • 1 yr ago
    • Reported - view

    Thank you both, got it working! The logic makes sense now

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 7Replies
  • 98Views
  • 3 Following