Accepting User Inputs With the Free Text Field | Prompt Builder for Developers

Estimated read time: 1:20

    AI is evolving every day. Don't fall behind.

    Join 50,000+ readers learning how to use AI in just 5 minutes daily.

    Completely free, unsubscribe at any time.

    Summary

    In this video by Salesforce Developers, you will learn how to integrate generative AI into Salesforce CRM workflows using Prompt Builder, with a focus on the new free text field feature introduced in the Winter '25 release. This feature, available on flex template types, allows developers to include user inputs in their prompt templates, enabling more dynamic and interactive AI solutions. The video provides a step-by-step guide on setting up and testing prompt templates, as well as invoking them through Apex and REST APIs, making it easy to implement AI capabilities in Salesforce applications.

      Highlights

      • Introduction to Prompt Builder's new free text input capability. ✨
      • Step-by-step guide on creating and activating a prompt template. 🛠️
      • Testing prompt templates using test inputs and configurations. 🎯
      • Invoking flex templates via Apex and REST for versatile integration. 🔧
      • Using the Salesforce Postman collection for API requests. 📬

      Key Takeaways

      • Prompt Builder now supports free text inputs, making AI interactions more dynamic! 🎉
      • Flex templates can incorporate user inputs and upstream automations. 🚀
      • Learn how to activate and test your prompts efficiently. ✅
      • Invoke your prompts via Apex or REST for seamless automation. 🔄
      • Great resources available for deeper learning – check them out! 📚

      Overview

      In the world of Salesforce, developers now have an incredible tool called Prompt Builder that enables the incorporation of generative AI in CRM workflows. With the Winter '25 release comes an exciting update - the free text field. This feature allows developers to capture user inputs directly into prompt templates, offering more dynamic and personalized AI interactions.

        The video provides a detailed walkthrough, starting from the setup of a new prompt template to testing and finally activating it. Developers are guided on how to switch the template type to 'flex', set up input fields, and invoke the template using Apex code or REST API. This ensures a smooth integration into existing Salesforce operations.

          For those looking to go beyond basic applications, invoking the templates externally via REST and utilizing tools like Postman makes it easier to connect their Salesforce solutions with third-party applications, enhancing the utility and reach of generative AI within CRM systems. The addition of resources in the description invites further exploration and mastery of these tools.

            Accepting User Inputs With the Free Text Field | Prompt Builder for Developers Transcription

            • 00:00 - 00:30 promp Builder is a tool that developers can use to incorporate generative AI in their Salesforce ERM workflows and Beyond when prop builder first released it supported incorporating CRM data using merg fields that reference record Fields related list Apex and flows and now with the winter 25 release you can add free text inputs to that as well with the new free text field which exists on the flex template type you can incorporate
            • 00:30 - 01:00 text from user inputs as well as Upstream automations and your prompt templates now if this is the first time that you've heard of promp Builder you should check out the promp Builder for Developers YouTube series on this channel otherwise let's get started we'll start in setup type prompt builder in the quick find search bar in prompt Builder setup click new prompt template in the new promp template
            • 01:00 - 01:30 screen change the template type to flex give your promp template a name and description in the input field change the type from object to free text and give your text field a name take note of the API names for the prompt template and the text Fields as you'll need them to invoke The Prompt template via Apex or rest inside of our Flex template we'll write a quick prompt to instruct our
            • 01:30 - 02:00 large language model to answer user inputs these are the inputs from the text field when we're done with our prompt template we can test our prop by clicking on test inputs in configuration and inputting some test values when we're done with our test values we can click on Save and preview to see how our prompt works when we're happy with our prompt we can go ahead and activate it by click cing
            • 02:00 - 02:30 activate Flex templates can be invoked via Apex and rest we're going to do both but let's start with Apex first we need to wrap our prompt inputs in this case we have just one user query next we'll add our input to a map which we'll call Value map the key for each input is the input plus the API name of the input which you can get from the prompt template
            • 02:30 - 03:00 settings next we create a prompt template Generations input object and add the value M then we configure the request by creating a prompt template Generations request object we set the template API name and add our inputs finally we can call the service and get the outputed text and there you have it by following these steps you can easily call your new prompt template for from Apex leveraging the flexibility of
            • 03:00 - 03:30 the flex template to integrate generative AI in your Salesforce applications we can also invoke our Flex template via rest for this we'll use the official Salesforce developers Postman collection to invoke your prompt template from an external service via rest call the Einstein templates API as a post request with your prompt template API name as a path variable you can find this API name in the prom template settings when calling the API you need
            • 03:30 - 04:00 to include two main keys in the Json body is preview and input params set is preview to false so that the request is actually processed by the large language model the input prams key contains an object with a value map key inside value map you should include your prompt inputs the key for your prompt input is input colon and your input's API name set a value key with the text you want to inject into the prompt and send it along now you're ready to integrate your
            • 04:00 - 04:30 prompt templates with a third-party app or service prompt templates are a great way to inject generative AI in your CRM workflows and Beyond and with the addition of the free text field on the flex template type they're even more flexible than ever if you're interested in learning more about prop builder and the free Tex field check out the resources in the description below otherwise thank you for watching the video we can't wait to to see what you
            • 04:30 - 05:00 built [Music]