Ask AI action

A Plauti Manipulate action

Last published at: August 11th, 2025
Delete

The Ask AI action is available for the Premium and PDM editions.

Use the Ask AI action to apply the strength of artificial intelligence to your daily operations. Use the action via the Action Launcher to get suggestions from one of the AI model providers for your specific questions related to the records you selected, or create macros with preconfigured prompts and reply-fields for repeated use in batch jobs and flows, or by your co-workers. 

At the moment Ask AI is available for Azure OpenAI, Google Gemini, AWS Bedrock, and OpenAI.

Apply field variables from the object and related Salesforce objects to integrate actual Salesforce data into the dialogue with AI, and to get different answers for each record.
Ask questions about selected records, and if desired about records related to the initial records. For example, select a number of Accounts, and ask AI to summarize certain Cases related to each of those Accounts.

Store the AI's responses in your Salesforce records for further processing. 

A number of examples and use cases are listed below; get more ideas for how to use the Ask AI action from our blog here

Ask AI to fill out the Department field of each selected record based on its Title field

Delete

Ask AI and Ask ChatGPT

Currently the Ask AI and Ask ChatGPT actions exist next to each other, with the only difference being that Ask AI is available for more AI endpoint providers than just OpenAI. In the future they will be merged. You can keep using your existing Ask ChatGPT actions, but it is recommended that you base new jobs, macros etc. on the Ask AI action instead.

Setting up the action

Before you can start using the Ask AI action, first configure it as follows:

  1. Subscribe to a text-based model of one of the four AI model providers: Azure OpenAI, Google Gemini, AWS Bedrock, or OpenAI. 
  2. Enable Remote Site settings to allow Salesforce to call out to your AI provider:
    1. Go to Salesforce Setup > Settings: Security > Remote Site Settings
    2. Click New Remote Site.
    3. Enter a name for the new remote site.
    4. At Remote Site URL, enter the endpoint URL of the AI provider. 
      • Azure OpenAI: the URL should be of the "https://your-resource-name.openai.azure.com/" format, where "your-resource-name" is the name of your resource.
      • Google Gemini: https://generativelanguage.googleapis.com
      • AWS Bedrock: for AWS, do not configure a remote site but create a Named Credential instead. Read more in Creating a Named Credential for Ask AI‍.
      • OpenAI: https://api.openai.com
    5. Make sure the Active box is ticked. 
    6. Click Save.
  3. Set up the Ask AI action settings:
    1. Go to Manipulate Setup. At left, go to the Action Library. At the 'Ask AI' action, click Edit.
    2. At Provider, select the AI model provider you want to use, and that you used in steps 1 and 2 above.
    3. At AI Model, enter the API name of the AI model you want to use and subscribed to.
      For example, enter gpt-4o for OpenAI or Azure OpenAI, gemini-pro for Google Gemini, or anthropic.claude-sonnet-4-20250514-v1:0 for AWS Bedrock.
      Only enter text-based models.
    4. At Temperature, enter a sampling temperature value between 0 and 2. Higher values like 1.5 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
    5. At API Key or Named Credential, enter the API Key belonging to your AI model subscription, or the Named Credential for AWS Bedrock you created in Creating a Named Credential for Ask AI‍. This Named Credential will usually be AWS_Bedrock.
    6. At Endpoint URL (only for Azure OpenAI), enter the Azure OpenAI endpoint URL (https://your-resource.openai.azure.com/). This should be the same URL as you entered in the Salesforce Remote Site settings earlier.
    7. Click Save.


Delete

Defining the right prompt

The different AI models are chatbots that will usually answer in full sentences. To have AI return text that you can use in your records, you will have to tell it specifically what kind of answer you want.
For example, if you want it to return one of the values of a picklist, add a sentence to the prompt listing all values of the picklist and say that it should only return one of those values. It's best to try it out with a text field first, to see what kind of answers you will get.
Or ask it to return an answer in JSON or another format if you want to process the answer further. Ask "Make sure to return plain text, no markup" if this is important for your answer.

Add Field Variables to your prompt to use specific data from each record. See the examples below.

When adding data from related records, it is recommended to include a field variable for the related record's name, ID, or other unique field in the follow-up prompt. That way AI can distinguish between data from the different records more easily.

Note that you can enter a long prompt, but Salesforce field limits do apply.

Using the Action

  1. Select the records that you want to apply the action to in a list view, or by creating a new job.
  2. In the Action Launcher (top right in list view, or the next window in the Manipulate Job modal), select Ask AI and click Next.
  3. In the next window, fill in the fields:
    1. At Prompt, fill in the prompt you want to use. 
    2. Add Field Variables‍ in the prompt (optional): place the cursor at the right spot in the text and click </> Field Variable the Field Variable button . Select the field you want to use the values of.
    3. Add data from related records (optional).
      Read more about this below at "Attach Data from Related Records". 
      1. Click + Attach Additional Data the Attach Additional Data button.
      2. At Lookup Object, select the related object to add data from.
      3. Click + Add Filter the Add Filter button (optional) to only use certain related records.
      4. Enter a Follow-up Prompt about the related records. Use Field Variables if needed. The follow-up Prompt will be repeated for each related record, and sent to AI as one large prompt together with the main prompt.
      5. If you change your mind and do not want to use data from related records after all, click + Remove Selected Records  to remove the related data configuration from the action.
    4. At Result Field, select a text field or picklist where you want to record the answers as returned by AI. 
    5. The Maximum Token Response Size shows the maximum output token size based on the size of the selected Result Field. The size set here makes sure that AI does not give an answer that is larger than would fit in the result field. A larger token response size would unnecessarily use up extra tokens, as the last part of larger answers cannot be stored in the result field. You can set a smaller token response size to get smaller answers and reduce cost.
      Read more about tokens for OpenAI in particular here; other AI model providers might handle tokens in a slightly different way.
    6. Click Next.
  4. In the confirmation window, check the details for the action, and click Start.

For each of the 8 selected Accounts, all related Opportunities are queried to gather information for AI to create a financial report with.

  • If you ran the action from a list view: once the progress bar is at 100% completed, click Finish to return to the object overview.
  • If you ran the action as a Job, you are returned to the Job Overview, where you can view the job results information via the Info button.

The answers that AI gave to your prompt are now saved on each record.

Delete

The Record Audit Log, if enabled, does not store the actual prompt and answer because of size limitations. It only records whether an answer was given or not.

Delete

Create a Macro

To use the action with the same prompt repeatedly, to use the action in batch jobs and flows, or to have your colleagues use the Ask AI action without them having to come up with a good prompt themselves, you can create a Macro‍. Assign the macro to users or profiles, and limit the use of the Ask AI action itself, to make sure AI is only used for certain prompts and result fields.

Combine data from records with data from their related records, and ask questions to AI based on this combined data, with the option "Attach Additional Data".

First you enter the main prompt, in which you can refer to information that will be gathered later on in the follow-up prompts. Then enter a follow-up prompt to gather data from the related records. It is recommended to include a field variable for the related record's name, ID, or other unique field in the follow-up prompt, so AI can distinguish between data from the different related records more easily.

Upon execution, the follow-up prompt is repeated for each of the related records. The main prompt and follow-up prompts are then sent together to the configured AI model as one API request. Do keep in mind that every model has a context window limit, which defines how many tokens a model can handle at a time.
AI then answers, and the answer is stored in a field on the initial record.

For example, select a number of Accounts, and ask AI to summarize certain Cases related to each of those Accounts. The Case summaries will then be stored in a field on the Account records.

Other use cases are, again with the example of Cases related to Accounts: asking for a trend in related cases created in the past three months, the most pressing case per account, etc. Or, ask AI to analyze all related Opportunities of an Account, and to create a financial report based on its analysis. The possibilities are endless.

Well, almost endless. The maximum of related records for synchronous execution is 9,999 related records per initial record, if the chunk size is 1. For asynchronous execution this limit is higher.

Examples

Object Prompt Result Field
Case Please summarize this customer case by studying the Case Subject: "{!Subject}" and description: "{!Description}". Your response must use bullet points. Summarize in a way so that a Customer Support employer working on this case can get the essence of the case quickly. Internal Comments
Case We are are car repair shop receiving customer cases with this subject "{!Subject}" and description "{!Description}". Please choose one of the following case reasons to determine the reason for this customer case: "Installation","Equipment Complexity","Performance","Breakdown","Equipment Design","Feedback" or "Other". Your response is limited to picking one of this reasons. if you cannot determine the correct reason please pick the option "Other". Case Reason, a picklist containing the case reasons listed in the prompt
Contact Please interpret the job title "{!Title}" and choose one of the following departments which this role is part of: Human Resources, Finance, Accounting, Sales, Marketing, Customer Support, Customer Success, Information Technology, Executive Management, Other. Your response should be limited to picking one of these departments. For example, your response could be "Customer Support". Do not reply with any other words. If the job title is not part of any of these departments, reply with the word "Other". Department
Account Please write me a bulleted pitch to tell {!Name} why they need <enter your product here> to solve their <enter a problem here> issues. A text field
Account and related Opportunities Prompt:
Please generate a financial report about the following opportunity data that I will share with you, related to account {!Name}. The financial report should be interesting to a CRO persona. Please return plain text, no markup.
Follow-up Prompt:
Opportunity Name: {!Name}
Opportunity Stage: {!StageName}
Opportunity Amount: {!Amount}
Opportunity Close Date: {!CloseDate}
Opportunity Created Date: {!CreatedDate}
Opportunity Type: {!Type}
A text field

Use Cases

Watch an example of how you can combine the forces of ChatGPT and Plauti's Data Action Platform to automatically analyze contacts and set their departments:

Watch an example of how you can combine the forces of ChatGPT and Plauti's Data Action Platform to analyze Cases and set the right Department:

Use your own classes for even more options

The Ask AI action can do a lot, but it is limited to the Object fields to retrieve information from. For example, for Cases you can only use information from fields such as the Description to use in questions for AI. If you'd like to use other data sources, such as case emails for Cases, you can build your own class and action. Create a class for Plauti Manipulate that calls the AI model's API, and include all Object data you want to provide. Then run the class you created with the Run An Apex Class action. Of course you can then also create a Macro for this action.

Or, to expand your options for using the AI answers, you can also implement the Ask AI action in a class, and create or update other Objects with the responses returned by AI. Send an Email Message, create a new Task, add a note to an Opportunity, the possibilities are endless. Read more about using an action in a class: Start an Action from an Apex Class.‍ 

Delete

Using AI

For subjects related to the use of the different AI models, such as accuracy or data privacy, we kindly refer you to the information available on each provider's website.