I want to get the count of character in the Text Area Field using omniscript in salesforce.
COUNT(%TextArea1%)!=''
I used the formula to get the count but unsuccessful.
// Get the value of the text area field
String text = {!Text_Area_Field__c};
// Get the length of the text
Integer count = text.length();
// Display the count on the screen
ScreenElement.displayMessage('The number of characters is ' + count);
This code will get the value of the text area field, calculate its length, and display it on the screen.
I used the OmniScripts Text Area Element documentation and the How to do a character count in rich text field forum post as references.
PS:
For more details and examples, you can refer to the Dig into the OmniScript Designer and Create a Simple OmniScript trailhead units.