I have a HTML email template with IF loop which is not working.

{!IF(NOT(ISNULL(pba__Closing__c.Buildings_survey_booked_To__c)),' to '+pba__Closing__c.Buildings_survey_booked_To__c,' ')}

There is another IF condition in same template and it works fine.

{!IF(NOT(ISBLANK(pba__Closing__c.Surveyor__c)),'<b>Surveyor / Company: </b>'+pba__Closing__c.Surveyor__c+'<br /><br />',' ')}

the Surveyor__c field is id field whereas the Buildings_survey_booked_To__c is Time field.

Can anyone spot the mistake....? The result of first if condition is always blank. but weird part is in 1st IF condition if i replace the Buildings_survey_booked_To__c field with other field...its works fine :)

  • Did you try changing ISNULL with ISBLANK? – tugce May 1 '19 at 8:49
  • Yes i tried ISNULL ISBLANK and event !=Null !='' Nothing works – Dnyaneshwar May 1 '19 at 11:31
  • Are you sure that Does Buildings_survey_booked_To__c has a value? If you display the field in the template by itself, what value is shown? – David Cheng May 1 '19 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.