-1

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.

1 Answer 1

0
// 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:

  • Open the OmniScript Designer by opening an OmniScript via the OmniStudio app.
  • From the Build panel, search for the screenElement you want to add, such as Text, Phone, or Website.
  • Drag the screenElement onto the canvas, inside a Step element. You can reposition, clone, and adjust the width of the screenElement with a 12-column snap-to-grid.
  • Configure the screenElement properties from the Properties panel. You can set the name, label, value, required, and other properties depending on the type of screenElement.
  • Preview your script in Preview mode and test how the screenElement looks and behaves.

For more details and examples, you can refer to the Dig into the OmniScript Designer and Create a Simple OmniScript trailhead units.

2
  • we are unable to find ScreenElement in Designer. Can you please guide how can we see and drag screenElement in canvas in the omniscript? Commented Aug 23, 2023 at 12:12
  • @AbdulRaheem, I have edited the answer and added steps. Commented Aug 23, 2023 at 12:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .