Reference > Expressions > Built-in Functions > System Functions > Prompt

Prompt

Displays a text box for the user to enter text and returns the text that the user entered.

Syntax

prompt(message, promptData, fieldAreaWidth, fieldAreaHeight, password, required, defaultValue)

Enabled for

Search/Dashboard Yes
Business Rules No
Quick Actions Yes
Workflow Objects Yes
Reports No

Parameters

This function takes at least two parameters and can take up to seven parameters. To enter a parameter without entering a value for a parameter before it, enter "" for the parameter for which you do not have a value.  For example, to enter the message, promptData, and fieldAreaHeight parameters, but no fieldAreaWidth parameter, enter $(Prompt(message, promptData, "", 25)).  In this example, the system uses 25 as the value of the fieldAreaHeight parameter and not the value of the fieldAreaWidth parameter.

 

message

The message that shows as a prompt.

promptData

The name of a pick list that provide values for the user to select from. If null or empty, the user must manually enter a value, instead of picking one from a pick list.

fieldAreaWidth

(Optional) The width of the text area in pixels.

fieldAreaHeight

(Optional) The height of the text area in pixels.

password

(Optional) Can be either true or false.

 

If true, the system treats the entered text as a password and displays it as asterisks when entered.

required

(Optional) Can be either true or false.

 

If true, the user must enter or pick a value.

defaultValue (Optional) The text value to return if the user does not enter anything or select a value.

Return Value

Text value.

Example

The following is an example of using this function in a quick action:

$(Prompt("Select Cause Code", "Incident Cause Code", 400, 200, false, true))

In this example, the required parameter is set to true, because the system prompts the user for a value that is required. This is to ensure that the user specifically chooses a proper value before the quick action is executed. In this example, there is no default value provided so there is no defaultValue parameter and therefore the function only has six parameters.

 

Add the following expression to the Resolution field of the Update Object quick action for the incident object:

$(Prompt("Please enter resolution", "", 400, 200))

This returns a prompt for a resolution note with an empty text area that is 400 pixels in width and 200 pixels in height.

 

Another example is in the Social Board where a quick action creates a business object.

$(Prompt("Summary", "", 350, 25, "", "", "_ConversationTitle_"))

$(Prompt("Description", "", 400, 200, "", "", "_ConversationContent_"))

In the first instance, the original post is included in the Summary field. In the second instance, the original post and the comments are included in the Description field.

 

You also can use this function in a saved search, to prompt an employee team when the search is being run.