AI Prompts for Salesforce Flow

This video explores how AI prompts and Streamscript enable you to carry out tasks like sentiment analysis, mortgage calculations, and currency conversion as examples.

 


 

Transcript:

Intro and survey example

Here is a flow that takes a survey.

But what we really want is the sentiment of the survey comments. Let's use AI to build a Streamscript solution.

 

Integration with Amazon Comprehend

Click the Prompt button, and it will translate that English requirement into a script. The survey data itself is never sent to the AI tool. This script is hosted in Salesforce and uses Amazon Comprehend for the sentiment.

 

Testing the script in a screen flow

Let's try it out.

"The service was fast and affordable" (that's a very positive comment)
"The service was..." and it can determine the sentiment is neutral.

 

 

 

Mortgage calculation example

Here's a second example. This Streamscript will get the calculations for a mortgage. Given the principal, the rate and the term in years, I'll click the Prompt button.

 

Generating self-contained logic

The financial data itself is never sent off platform, and the script that it gave us runs independently of the tool - now and into the future.

 

Testing monthly payments and interest

Let's try it out. For a principal of 256K, at 4.5%, over 20 years it's going to give us the monthly payment, the total payment, and the total interest.

 

 

 

Currency exchange rate example

Here's a third example. We're going to ask Streamscript to give us a currency exchange calculation, and we've told it to use this particular API. Let's click Prompt.

 

HTTP callout to conversion API

The AI tool builds a script from the prompt, and the script happens to use an HTTP callout. It'll perform the conversion and return the result.

 

Testing the script in Debug mode

For 100 USD converted into EUR, it's going to tell us the live conversion is 93 EUR.

 

 

 

How to configure OpenAI API Key

Here's how you get set up. When you use Streamscript, it requires that you obtain your own API key for AI completions, as we do not get between you and OpenAI. So right-click the Prompt button. Then paste your API key in here. And that's how you can build self-contained logic using AI prompts. Your scripts may benefit from the tool without giving away your data.

 

 

 

Getting started with Streamscript
Install from the Salesforce AppExchange
Package install link: /packaging/installPackage.apexp?p0=04tGA000005VVeA