You need to sign in to do that
Don't have an account?
Molson94
Creating CSV from List: Handling Null Values
Hello,
I am creating a CSV file to email and attach to the parent object.
What I am running into is that any fields without values are being added to the csv file in the email as "null".
This makes sense since not all fields will have values.
Is there a way around this? Ideally the csv file would show blank instead of null.
Thanks!
I am creating a CSV file to email and attach to the parent object.
What I am running into is that any fields without values are being added to the csv file in the email as "null".
This makes sense since not all fields will have values.
Is there a way around this? Ideally the csv file would show blank instead of null.
Thanks!
Instead of using direct field value like objInstacne.Field__c put a null check condition.
( objInstacne.Field__c != null ) ? objInstacne.Field__c : '';
Here objInstacne is the instance of the record and Field__c is the API name of the field.
Let me know if you still face issue.
Thanks
Shashiakant
All Answers
Instead of using direct field value like objInstacne.Field__c put a null check condition.
( objInstacne.Field__c != null ) ? objInstacne.Field__c : '';
Here objInstacne is the instance of the record and Field__c is the API name of the field.
Let me know if you still face issue.
Thanks
Shashiakant
I tried what you mentioned above but i am still getting compiling errors.
Depending on the field that i am using i am getting some variation of: Incompatible types in ternary operator: Decimal, String