Now that your org is setup for Agentforce and has Forms for Salesforce installed, you can get started on your Agent!
Note: before setting up the Agent’s steps, you need at least one form created, published and that has at least one submission completed. This is required so that the Agent can find fields and submit data on its own. For example, “Patient Registration” can be the form name and the agent will find it if you say “I am a new patient” in the chat window.
Step 1: Create an Agent
From Setup in Salesforce, go to Einstein Generative AI > Agent Studio. Click on “New Agent” to start creating your Agent. Within this window, follow the prompts to fill out the needed fields for your Agent.
Saving here will open the Agent Builder UI, where you will configure Topics and Actions.
Step 2: Create a Topic
Here are some example settings for creating a Forms for Salesforce-specific topic:
-
Topic Label: Forms
-
Classification Description: This topic relates to submitting data. Things like submitting a case, registration, intake, etc.
-
Scope: Your job is to find the most relevant form and collect the data before submitting it. Once a user starts answering a form, do not leave the topic until the form is submitted.
-
Instructions:
-
Always be polite but enthusiastic in your answers.
-
Always find the most relevant VisualAntidote__Previous_Form__c, also called Form, record, based on the Name.
-
Never output the form name.
-
Once the Form relevant form has been identified, generate a new text using the Agent Description field. This field should never be output directly.
-
Always transform the field’s content using the context provided in the content. Never output the form name.
-
Remember the Form Specific Agent Instructions.
-
Always Identify the object and the different fields contained in the VisualAntidote__Fields_xml__c field.
-
If the fields have already been identified, remember them.
-
Always ask a question for each field. Never ask a question for a hidden field. Do not group questions together.
-
Always try to map the user’s input to a field.
-
Never ask a question that isn’t coming from the fields identified from the field XML.
-
Never tell the user which page number they are on.
-
Based on the found form record, always get all the related VisualAntidote__Form_Page__c, also called Page.
-
If a field has a list of picklist values, ask the user to pick one.
-
If the question asked is for a first name, assume that the user might provide the first and last name at the same time.
-
If the user provides both answers, do not repeat the question.
-
To create a submission, always use the Submission Template, contained in the Form, and replace the TEMPLATE_FIELD with the corresponding values.
-
Always retrieve the Last Successful submission and update the content of the VisualAntidote__Submitted_Data_XML__c with that new string.
-
Step 3: Assign Action to the Topic
Within Agent Builder, navigate to the Action subtab. Here you will add custom actions that you want your Agent to perform. The Formstack Agentforce Extension includes a series of Flows specific to finding Forms and triggering Document merges → using these will let your Agent leverage Formstack resources.
It will also let you access or create any other Flows in your org that you’d like to use.
Step 4: Launch
After your Agent is configured, you will need to test, activate and deploy your Agent in the correct location(s) within your Salesforce org. Because this is an AI-based feature, you will also need to monitor its performance and make needed adjustments to topics and instructions, thus ensuring it is accurate and effective.