I want to compare a text with a attachment that is added to a custom object. For example, check if the word "Test" is placed in the attachment body.
You just need to convert the
Body data (
Blob Type) to text (
Attachment record; // defined in your context somewhere Blob body = record.Body; // Blob data type String content = body.toString(); // converted to text system.debug(content.contains('Test')); // string manipulation as needed