Newer Version Available
Prompt
File Suffix and Directory Location
Prompt components have the suffix prompt and are stored in the prompts folder.
Version
Prompt components are available in API version 46.0 and later.
Special Access Rules
Admins have access to add or edit prompts. For non-admin users, assign the Manage Prompts and Modify Metadata user permission. Everyone can see the In-App Guidance setup page.
Packaging Prompts
See Creating Managed Packages in Salesforce Help for more information.
See Considerations for Prompts in Lightning Experience in Salesforce Help for more information about installing and managing prompt packages and about editing and cloning prompts installed from packages.
Unmanaged packages for prompts isn’t supported.
When orgs install prompts from packages, the prompts will be the same publish state as indicated by the IsPublished field. For example, if the package prompt is active, it will also be active when installed by the user.
If the package includes a custom profile or permission that isn’t part of the installer’s Salesforce org, the prompt is installed, but it won’t include those items. For example, you install a prompt with several custom profiles not included in your org. The prompts are installed without those custom profiles.
If the package includes a standard app that isn’t part of the installer’s Salesforce org, the prompts are installed, but aren’t usable.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| masterLabel | string | Required. The master label for the prompt. Maximum of 80 characters. |
| promptVersions | PromptVersion[] | A list of prompt entries. Each entry represent a different prompt. |
PromptVersion
A list of prompt entries. Each entry represents a different prompt.
| Field Name | Field Type | Description |
|---|---|---|
| actionButtonLabel | string | Label for the action button. Maximum of 25 characters. |
| actionButtonLink | string | URL for the action button. Maximum of 1,000 characters. You can’t use the GROUP BY option in a SOQL query for this field. |
| body | string | Required. Body content of the prompt. For floating prompts, there’s a maximum of 120 characters. For docked prompts, there’s a maximum of 4000 characters. |
| customApplication | string | Internal use only. No data is populated for this field. |
| delayDays | int | Required if recurrences are scheduled. Number of days in between occurrences of the prompt. |
| description | string | Description of the prompt. Maximum of 255 characters. |
| dismissButtonLabel | string | Label for the dismiss button of a floating prompt. Maximum of 15 characters. |
| displayPosition | PromptDisplayPosition (enumeration of type string) | Indicates the position of the floating prompt on the page. Valid values are:
|
| displayType | PromptDisplayType (enumeration of type string) | Required. Indicates the type of prompt. Valid values are:
|
| endDate | date | Indicates the date to stop showing the prompt. |
| header | string | Label for the header of the docked prompt. This is the label contained in the window’s browser bar. Maximum of 36 characters. |
| indexWithIsPublished | string | Used by Salesforce for efficient querying. |
| indexWithoutIsPublished | string | Used by Salesforce for efficient querying. |
| isPublished | boolean | Indicates if a prompt is active true or not false. |
| masterLabel | string | Required. The master label for the prompt. |
| publishedByUser | string | Internal use only. No data is populated for this field. |
| publishedDate | date | Indicates the date the prompt was activated. If the prompt is part of a package, this is the date when the package was installed. |
| shouldDisplayActionButton | boolean | Required. Indicates if an action button is included in the prompt true or not false. |
| shouldIgnoreGlobalDelay | boolean | Indicates if the prompt ignores the global time delay between prompts and instead shows on page load true or not false. This field is available in API version 48.0 and later. |
| startDate | date | Required. Indicates the date to start showing the prompt. |
| targetAppDeveloperName | string | Required. The app’s developer name where the prompt appears. |
| targetAppNamespacePrefix | string | The app’s namespace prefix where the prompt appears. |
| targetPageKey1 | string | Required. Used by Salesforce to identity the prompt page location along with targetPageKey2 and targetPageType. |
| targetPageKey2 | string | Used by Salesforce to identity the prompt page location along with targetPageKey1 and targetPageType. |
| targetPageType | string | Required. Used by Salesforce to identity the prompt page location along with targetPageKey1 and targetPageKey2. |
| timesToDisplay | int | Required if recurrences are scheduled. Maximum number of times to display the prompt (that is, the number of occurrences). Salesforce detects if the user interacts with (or ignores) the prompt to determine if we should show the prompt again or cancel scheduled recurrences. This might run counter to the number of occurrences scheduled. Maximum value of 30. |
| title | string | Required. The label for the title of the prompt. Maximum of 36 characters. |
| uiFormulaRule | UiFormulaRule | A set of one or more permission filters that define the conditions under which
the prompt displays on the page. If the rule evaluates to true, the prompt displays on the page. If false, it doesn't display. If this field is null, the prompt displays by default. |
| userAccess | PromptUserAccess (enumeration of type string) | Required. Indicates which permissions can see the prompt. Valid values are:
|
| userProfileAccess | PromptUserProfileAccess (enumeration of type string) | Indicates which profiles can see the prompt. This field is available in API
version 48.0 and later. Valid values are:
|
| versionNumber | int | Required. The number remains 1 since multiple versions aren’t saved in the org. |
| videoLink | string |
The URL for the video in a docked prompt. Maximum of 1,000 characters. This field is available in API version 48.0 and later. To find the embed code for a video, follow the instructions from the video host website. Usually the steps can be found by searching for the name of the website and “embed video.” For example, here’s what the embed code looks like for YouTube: <iframe width="560" height="315" src="https://www.youtube.com/embed/Ko-gcObzTVo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> Then, you would enter the URL found in the src attribute. For the example used, enter https://www.youtube.com/embed/Ko-gcObzTVo. |
UiFormulaRule
A set of one or more filters that define the conditions under which a prompt displays on a Lightning page.
| Field Name | Field Type | Description |
|---|---|---|
| booleanFilter | string | Specifies the AND filter condition. |
| criteria | UiFormulaCriterion[] | List of one or more filters that, when evaluated, determine prompt visibility. |
UiFormulaCriterion
A single filter that, when evaluated, helps define prompt visibility on a Lightning page.
| Field Name | Field Type | Description |
|---|---|---|
| leftValue | string | Required. The field upon which the filter is based. Only standard and custom
permissions can be included. You can use these expressions in the
leftValue field when setting filters for prompt visibility.
|
| operator | string | Required. Defines the operator used to filter the data. Valid value is EQUAL. |
| rightValue | string | Specifies if you want to evaluate the prompt’s visibility for permissions or
the name of the profile.
|
Declarative Metadata Sample Definition
The following is an example of a Prompt component.
The following is an example package.xml that references the previous definition.
Wildcard Support in the Manifest File
This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.