Skip Navigation
Expand
Usage of dollar sign ($) in an answer
Answer ID 8813   |   Last Review Date 10/17/2019

How do I use dollar sign ($) in an answer?

Environment:

All versions, Answers, Customer Portal
Oracle B2C Service

Resolution:

Dollar sign ($) can be used to insert custom Variables into an answer, as explained in Answer ID 415: Creating and using system and answer variables. Meanwhile, the dollar sign can also be displayed differently based on the characters immediately following it. 

For single dollar sign:

1. If followed by a string starting with alphabetical characters, the dollar sign will be treated as custom variable prefix. If a matching custom variable exists, the variable content will be displayed. Otherwise, the string content will be displayed as-is.

2. If followed by a numeric character immediately, the text will not be treated as customer variable. So monetary units can be entered as normal.

For double dollar signs:

1. If used alone, only one $ sign will be displayed.

2. If followed by any string, either starting with alphabetical or numeric character, then the text will not be treated as customer variable and will be displayed as-is.

Please refer to the following table for example. In this scenario, we assume a custom variable $variable is defined in the system with content text: 'Hello!'

Content in Answer Source

 Display on Customer Portal

 Note

 $variable  Hello!  Matching variable exists and variable content is displayed.
 $randomtext  $randomtext  No matching variable, so text is displayed as-is.
 $123  $123  Followed by numeric character immediately, not treated as variable. 
 $$  $  Double dollar sign used alone, only one $ sign is displayed.
 $$variable  $variable  Double dollar sign followed by string, not treated as variable, displayed with only one $. Use three $$ in order to display two $.