Fixing Salesforce Agentforce CSV Upload Error: Missing Scenario Column

Fixing Salesforce Agentforce CSV Upload Error: Missing Scenario Column

Using this Blog Post, you will be able to troubleshoot the Salesforce Agentforce Testing Center error: “No Scenario column found in CSV” error or exception. Learn how hidden UTF-8 BOM characters (\ufeff) break CSV parsing and how to fix it fast.

How to Fix Salesforce Error: “No Scenario column found in CSV”

When setting up conversation-level testing in the Salesforce Agentforce Testing Center, importing test cases via CSV is standard workflow. However, developers, admins, and architects frequently encounter this error during import:

No Scenario column found in CSV. Please create a text column named 'Scenario' for conversation-level testing.

Even when your CSV clearly has a header named Scenario, Salesforce refuses to recognize it.

Understanding the Root Cause

This error typically occurs due to one of two reasons:

  1. Missing or Misspelled Header: The column header is not named Scenario exactly (case sensitivity or typos).
  2. UTF-8 Byte Order Mark (BOM) Contamination: This is the most common hidden cause. When saving CSV files in certain applications (such as Microsoft Excel or localized text editors), a invisible byte order mark (\ufeff) is prepended to the very beginning of the file.

When Salesforce parses the first column header, instead of seeing:

Scenario

It interprets the raw binary header as:

\ufeffScenario

Because \ufeffScenario does not match Scenario, the validation parser fails immediately and reports that the mandatory column is missing.

Step-by-Step Resolution

Step 1: Verify Header Naming and Case

Ensure the first column header in your CSV is literally named Scenario without extra spaces, lowercase letters, or special characters.

Example valid CSV structure:

Scenario,Utterance,ExpectedResult
"Booking Test","Book a hotel in Toronto","Success"

Step 2: Strip UTF-8 BOM Encoding

To remove the hidden \ufeff prefix from your CSV file, use one of the following methods depending on your development toolchain:

Method A: Using VS Code

  1. Open the CSV file in Visual Studio Code.
  2. Look at the bottom-right status bar. If it shows UTF-8 with BOM, click on it.
  3. Select Save with Encoding.
  4. Choose UTF-8 (without BOM).
  5. Save the file (Ctrl+S or Cmd+S) and re-upload to Salesforce.

Method B: Using Notepad++ (Windows)

  1. Open the file in Notepad++.
  2. Click on Encoding in the top menu bar.
  3. Select Convert to UTF-8 (instead of UTF-8-BOM).
  4. Save and re-upload.

Leave a Reply