Prompt Action Framework

Picture of Kalanithi Balasubramanian

Kalanithi Balasubramanian

Updated on December 16, 2024

The Prompt Action Framework is a functionality within the Prompt Builder that allows users to perform various actions on a record when a prompt is run.

These actions are specific to each prompt and can be configured in the Actions Tab of the prompt setup.

Adding Actions

  • Locate the Actions Tab: When creating or opening a prompt, navigate to the Actions Tab.

  • Add Actions: Click the plus (+) icon, which opens a pop-up window containing a dropdown list of actions.

  • Select an Action: Choose from the available actions listed below. Each selected action opens a configuration window for further details.

Available Actions

  • One can’t create, update, or delete an action when the prompt is activated.

1. Update Field

This action updates a field on the record where the prompt is run with that particular AI response.

Steps to Configure:

  • Select Update Field from the dropdown.
  • Configure the following in the pop-up window:
    • Action Type: Displays the selected action (modifiable).
    • Description: Add a description of the action.
    • Sequence: Define the execution order among multiple actions.
    • AI Response: Specify the AI-generated value to update.
      For JSON prompts, individual nodes of the JSON can be used.
    • Field: Select the field to be updated.
    • Append Timestamp: Enable this checkbox to append a timestamp for audit purposes.

2. Create Record

This action allows the creation of a new record for a specified object.

Steps to Configure:

  • Select Create Record from the dropdown.
  • Configure the following in the pop-up window:
    • Action Type: Displays the selected action (modifiable).
    • Description: Add a description of the action.
    • Sequence: Define the execution order among multiple actions.
    • Object: Select the target object for the new record.
    • Field Mapping: Specify field values:
      • Hardcoded: Manual entry of fixed values.
      • Reference Field: Map values from fields on the current record.
      • AI Response: Use AI-generated values to support JSON components for JSON prompts.
    • Add/Remove Fields: Use the Add Row or delete icon to manage field mappings.

3. Invoke Flow

This action triggers a Salesforce Flow.

Steps to Configure:

  • Select Invoke Flow from the dropdown.
  • Configure the following in the pop-up window:
    • Action Type: Displays the selected action (modifiable).
    • Description: Add a description of the action.
    • Sequence: Define the execution order among multiple actions.
    • Flow: Provide the API name of the Flow to invoke.

4. Invoke Apex

This action executes a Salesforce Apex class.

Steps to Configure:

  • Select Invoke Apex from the dropdown.
  • Configure the following in the pop-up window:
    • Action Type: Displays the selected action (modifiable).
    • Description: Add a description of the action.
    • Sequence: Define the execution order among multiple actions.
    • Apex Class: Enter the API name of the Apex class.

5. Open a Form

This action opens a pre-configured form for data entry or updates.

Steps to Configure:

  • Select Open a Form from the dropdown.
  • Configure the following in the pop-up window:
    • Action Type: Displays the selected action (modifiable).
    • Description: Add a description of the action.
    • Sequence: Define the execution order among multiple actions.
    • Object: Select the target object for the form.
    • Field Mapping: Specify field values using:
      • Hardcoded: Manual entry of fixed values.
      • Reference Field: Map values from fields on the current record.
      • AI Response: Use AI-generated values.
    • Add/Remove Fields: Manage fields with the Add Row or delete icon.
  • Once the prompt is run, an Open a Form button appears in the expanded view on the GPTfy console.
  • When a prompt is run, actions execute in the specified sequence.
  • For “Open a Form,” the number of forms displayed corresponds to the number of ‘Open a form’ actions configured.
  • If record types are specified, they will be included automatically, and mapped values will be pre-filled.