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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Copilot Studio Prompt ...
Copilot Studio
Suggested Answer

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

(3) ShareShare
ReportReport
Posted on by 9
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 (5)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,433 Super User 2025 Season 2 on at
     
    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
    9 on at
    @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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 261 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

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

#3
S-Venkadesh Profile Picture

S-Venkadesh 93 Moderator

Last 30 days Overall leaderboard