+ Start a Discussion
Muhammad Jawwad 16Muhammad Jawwad 16 

How to replace null to "-" after fetching the query result in the sending email template?

User-added image
Khan AnasKhan Anas (Salesforce Developers) 
Hi Muhammad,

Greetings to you!

Please refer to the below link which might help you further with the above requirement.


I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Sarah J DSarah J D
Hi Muhammad,

Before sending the email, do a null check and replace all the null field with a hyphen '-'.


List<Account> accList = [SELECT Id,Name,DataComs__c FROM Account WHERE Name=:'DELL'];

If my field is Date__c,

1. Null Check: 
for(Account acc:accList)