Salesforce Apex Invocable Methods – Part 7: Flex Prompt Template Grounded with Apex
Автор: Code With Sally
Загружено: 2025-09-26
Просмотров: 113
🚀 In this session, we explore Flex Prompt Templates in Salesforce Prompt Builder and learn how to ground them using Apex Invocable Methods. This is a continuation of our Invocable Methods series, where we previously explored Sales Email and Field Generation templates.
🎯 Use Case:
We automate the weekly video publishing process for Code With Sally — generating:
🎥 YouTube title
📝 Description
⏱️ Timestamps (formatted for chapters)
📢 LinkedIn & Twitter announcements
…all using one LWC component, one Flex prompt, and a grounded Apex method!
✅ What You’ll Learn in This Session:
===============================
🔁 Quick recap of Invocable Methods: how and where they’re used
🧩 Comparison between Prompt Template types: Sales Email, Field Generation, and Flex
📦 Use case deep dive: real-life problem, data model, and automation goals
🧠 How to create a Flex Prompt Template (step-by-step)
⚙️ How to test prompts inside Prompt Builder
🚫 Can we edit prompt template inputs once created? (important tip!)
🧵 Creating and grounding Invocable Methods for Flex templates
📄 How to change the prompt template’s prompt to request results in JSON format
💡 How to structure Invocable Method responses as a JSON string to pass to the Prompt Template
⚠️ Case sensitivity and variable mapping gotchas for inputs and outputs
📥 Options for invoking prompts: Apex, Flow, or REST API
📌 In our next session, we will learn how to call the Flex Prompt Template from Apex!
👉 Subscribe to the channel and share the video to support others learning Salesforce development!
🔗 GitHub Code: https://github.com/CodeWithSally/Code...
⏱️ Timestamps
00:00 - Welcome + Channel Reminder
02:08 - Quick recap on Invocable Methods
03:44 - Where can Invocable Methods be called from?
04:34 - Comparison between Prompt Template types (Sales Email, Field Generation, Flex)
10:15 - Use Case Demo Overview: Automating Code With Sally weekly video process
15:32 - Step 1: Data Model (Video, Playlist, VideoPlaylist)
16:05 - Step 2: Enable Einstein AI + Assign Permission Sets
17:24 - Step 3–4: Create Simple Flex Template (No Apex Grounding) + Test in Prompt Builder
25:16 - ⚠️ Can we update Prompt Template inputs once created?
28:10 - Create Advanced Flex Prompt Template (with JSON output preparation)
32:27 - Step 5–6: Create Invocable Method for Flex Template + Ground it
47:46 - Walkthrough of Apex logic to return Playlists & Videos in JSON format
01:01:49 - Summary of Invocable Method rules for Flex Templates
01:03:35 - Next Steps: Invoking Prompt Template from Apex (covered in next session) + Closing
#Salesforce #Apex #InvocableMethods #FlexPromptTemplate #PromptTemplates #EinsteinGPT #SalesforceAI #CodeWithSally #LWC #SalesforceDevelopers #AIinSalesforce
================================
Music I Use: Bensound.com/royalty-free-music
License code: I1PDXBGOE4CFA2WG
Artist: : Benjamin Tissot
Music by: Bensound
License code: 9DNPPQUDYE9ZVJHV
Artist: : Benjamin Tissot
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: