---
schema_version: "1"
id: 18ec25da38c37a8cb1683786772dfe0dcb0156edf31231ad9fd106e209a5fd0b
title: Conditional Logic in Prompt Templates Is Generally Available
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/release-notes/264-0-0/rn_einstein_prompt_builder_conditional_logic.md
canonical_url: https://help.salesforce.com/s/articleView?id=release-notes.rn_einstein_prompt_builder_conditional_logic.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 3bc8211e9fe9011922a563d5e6021f099f515e2fd4d4751139a336d314438828
description: 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.
products:
  - Cross Cloud
release: "264"
---
# Conditional Logic in Prompt Templates Is Generally Available

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](http://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**.

#### See Also

- [_Salesforce Help_: Use Conditional Logic in Prompt Templates](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_use_conditional_logic.htm&type=5&language=en_US)
- [_Salesforce Help_: Add Conditional Logic to a Prompt Template](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_add_conditional_logic.htm&type=5&language=en_US)
- [_Salesforce Help_: Understand the Block Editor](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_understand_block_editor.htm&type=5&language=en_US)