Conditional logic in generative AI prompt templates is generally available. Add
if, else if, and else blocks so that
one prompt template adapts based on grounded data.
Where: This change applies to Lightning Experience in Enterprise, Performance, and Unlimited editions with Einstein for Platform, or Einstein or Agentforce for Sales or Service add-on, or Agentforce Foundations.
When: This change is available in Salesforce orgs upgraded to Winter ’27 starting the week of October 12, 2026. Go to trust.salesforce.com for exact dates.
Why: One prompt template handles multiple scenarios instead of maintaining a separate template for each case. Conditional blocks evaluate merge fields from your grounded data and include the matching text in the prompt sent to the AI model.
How: Conditional logic is generally available in the Block Editor. A setup toggle is no longer required.
From Prompt Builder, create a prompt template or convert an existing template from
the Classic Editor to the Block Editor. Type / to open the
slash-command menu, and then select Conditional Block or
If Statement. In the condition field, enter an expression
using merge fields and operators. For example, {!Case.Priority} ==
"High". Add text for the if branch. To cover
more scenarios, click Add Else If or Add
Else. Test with Preview, and then click
Save.