web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Copilot Studio - General
Suggested answer

Copilot Studio Prompt Tool Error: “Unexpected token 'P', 'Process ac'... is not valid JSON”

(3) ShareShare
ReportReport
Posted on by 2
I'm trying to create a custom prompt in Copilot Studio by going to Tools → New Tool → Prompt. 
As a test, I selected the prebuilt prompt from the prompt library titled "Extract information from receipt".
When I try to test it using the built-in Test button, I immediately get this error:
Unexpected token 'P', "Process ac"... is not valid JSON
I didn’t modify the prompt itself — I used it exactly as provided from the prompt library.
It seems like the test runner is expecting JSON input, but no test input panel or instruction appears until after you manually add content. There’s no clear documentation on how to fix this.
Has anyone else run into this? Am I missing a step like defining input variables or test JSON?
Any help would be greatly appreciated!
 
Categories:
I have the same question (2)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    50,281 Super User 2025 Season 2 on at
    Copilot Studio Prompt Tool Error: “Unexpected token 'P', 'Process ac'... is not valid JSON”
     
    Without seeing the actual receipt you provided as the example its a little hard, but what I can say is your Example (unless it scrolls down) is not a valid JSON, as its missing a } at the end.
     
  • Community member Profile Picture
    2 on at
    Copilot Studio Prompt Tool Error: “Unexpected token 'P', 'Process ac'... is not valid JSON”
    @Michael E. Gernaey

    As i mentioned before i use the prebuilt prompt from prompt library called "Extract information from receipt". This is the prompt:

    Extract and categorize all information from a valid , ensuring all values are appropriately formatted according to their data types.

    Respond only with the results in JSON format. The JSON object should include the following fields: 'MerchantName', 'MerchantPhoneNumber', 'MerchantAddress', 'Total', 'TransactionDate', 'TransactionTime', 'Subtotal', 'TotalTax', 'Tip', 'Items', 'Items (Credits)', 'Items (TotalPrice)', 'Items (Description)', 'Items (Date)', 'Items (Quantity)', 'Items (Price)', 'Items (ProductCode)', 'Items (QuantityUnit)', 'Payments', 'Payment (Method)', 'Payments (Amount)', 'TaxDetails', 'TaxDetails (Amount)', 'TaxDetails (Rate)', 'TaxDetails (NetAmount)', 'TaxDetails (Description)', 'CountryRegion', and 'ReceiptType'.

    Example:

    {

    'Items': [

    {

    'Date': '27Mar21',

    'Description': 'Room Charge',

    'Price': 88

    }

    ],

    'Payments': [

    {

    'Method': 'American Express',

    'Amount': 104.92

    }

    ],

    'CountryRegion': 'USA',

    'ReceiptType': 'Hotel'

    }

    The receipt can belong to one of the following categories: 'Retail meal', 'Credit card', 'Gas', 'Grocery', 'Fashion', 'Electronics', 'Furniture', 'Pharmacy', 'Hotel', 'Transportation', 'Parking', 'Entertainment', 'Fitness', 'Office supplies', 'Software', 'Consulting', 'Education', 'Auto repair', 'Toll', 'Restaurant', 'Bar', 'Fast food', 'Coffee', 'Hospital', 'Insurance', 'Donation', 'Travel', and 'Utility'.

    Ignore blank fields from the response.

    Note: i even tried simple prompts adn still getting the same error in Model Response

  • CU14101909-1 Profile Picture
    2 on at
    Copilot Studio Prompt Tool Error: “Unexpected token 'P', 'Process ac'... is not valid JSON”
    I am getting this now - it's like it's a hard coded bug

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Copilot Studio

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 523 Super User 2025 Season 2

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 378 Super User 2025 Season 2

#3
DAnny3211 Profile Picture

DAnny3211 132

Last 30 days Overall leaderboard