Step 2 - Create a Prompt Template in Prompt Builder

Now that you have a Document AI configuration to process resumes, set up a prompt template to handle Document AI’s output.

Create a New Prompt Template 

  1. Go to Setup.
  2. In the Quick Find search bar, find and select Prompt Builder.
  3. On the Prompt Builder setup page, click New Prompt Template.
  4. For Prompt Template Type, select Flex.
  5. Enter a name for your prompt template (for example, Handle JSON From Document AI).
  6. Under Inputs (Optional), add one input:
    • Name: inputString
    • Source Type: Free Text
  7. Click Next.
  8. In the prompt screen, paste this prompt.
1Instruction:
2You are a JSON data formatter.
3
4Input:
5You will receive raw JSON as a string that may include schema, metadata, or other non-essential fields.
6
7Raw JSON Input:
8Input:inputString
9
10Task:
11- Parse the JSON.
12- Ignore technical fields like schema, metadata, or keys starting with _ that don't add meaning for a user.
13- Convert the remaining key-value pairs into a clean, human-readable format. > Label: Value; for each pair.
14- Separate pairs with ; and add a line break between logical sections if there are nested objects or arrays.
15- Label should be continuous without spaces, add _ if necessary
16
17Example Output >
18Candidate_residential_state:TX;Candidate_residential_zip_or_pin_code: 78701;Street_address:1456 Oak Avenue;Candidate_residential_city:Austin;Other_Phone_number:(512) 555-0347;Mobile_phone_number:(512) 555-0892

Make sure that the value inputString in the prompt template (Input:inputString) is spelled exactly as you spell it in the prompt instruction.

Note

  1. From the Models dropdown on the left, select GPT 4.1. This model handles JSON and structured output reliably.
  2. Click Save and then click Activate.
  3. Confirm that your newly created prompt template appears on the Prompt Builder home page.
  4. Copy the prompt template ID, as explained below.

How to Find the Prompt Template ID

The prompt template ID is typically part of the URL of the template in the Prompt Builder.

For example, in this URL the prompt template ID is 0hfKZ000000PPrNYAW:

https://trailsignup-5fca1e948037d6.lightning.force.com/lightning/setup/EinsteinPromptStudio/0hfKZ000000PPrNYAW/edit?c__versionId=3vNKZ000000U0ma2AC

Tip

Next Step