Copilot Not Working

Fix Microsoft Copilot Returning Placeholder for Dice Roll

Adam DavisAdam Davis Oct 10, 2026 869 views

Question details

The user needs to resolve an issue where Microsoft Copilot outputs a raw code string rather than generating a random number for a dice roll.

How to Fix Microsoft Copilot Returning Placeholder {{random_int(1, 20)}} for Dice Rolls
Product
Microsoft Copilot
Device & OS
not provided
Scenario
Asking Copilot to roll a 20-sided die (d20) using natural language or the /r 1d20 command.
Observed behavior
The AI returns the literal placeholder string {{random_int(1, 20)}} instead of a randomized number.
Before you start

Ensure you have a stable internet connection and try refreshing your browser or restarting the Copilot app to rule out a temporary rendering glitch on the server side.

Solution 1Recommended

Refresh Session and Submit Feedback

Since this is typically a backend rendering issue, reporting it and resetting your environment often resolves it.

Microsoft Copilot occasionally experiences rendering bugs where internal functions fail to execute, causing the AI to display the raw backend code instead of the final result. This is usually a temporary server-side issue.

1
Downvote the incorrect response

Click the thumbs-down (dislike) icon next to the response containing the placeholder. This alerts Microsoft's engineering team to the rendering failure.

2
Start a new topic

Click the 'New Topic' or 'Refresh' button to clear the current context and establish a fresh connection with the Copilot servers.

3
Test alternative prompts

Instead of using the /r 1d20 command, try typing 'Roll a 20-sided die' in plain text to see if a different parsing method bypasses the bug.

4
Switch environments

If the issue persists in the web browser, try testing the same prompt in the Copilot mobile app, the Edge sidebar, or via the Copilot API if you have access.

Refresh Session and Submit Feedback
Expected Output: When functioning correctly, Copilot will display a number alongside descriptive text like '(rolls a 20-sided die) = 12'. It can also handle advantage rolls by displaying two numbers and automatically selecting the higher one.
Free Microsoft Office alternative

Try WPS Office with Built-in AI Capabilities

If you are experiencing frequent glitches with Microsoft tools or want a reliable, unified workflow, consider switching to WPS Office. It provides a lightweight, highly compatible, and free alternative to Microsoft Office, featuring its own robust AI assistant to boost your productivity without the hefty subscription fees.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installer for your preferred operating system.
  2. 2. Install and Launch: Run the installer and open WPS Office. The familiar interface will allow you to continue working on your documents immediately.
  3. 3. Explore WPS AI: Open a new document and activate WPS AI to assist with writing, formatting, and data analysis tasks.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Built-in WPS AI to help you generate, summarize, and analyze text effortlessly without relying on Copilot.Lightweight installation that runs smoothly on Windows, Mac, Linux, and mobile devices.Free to use with a familiar, user-friendly interface for seamless migration from Microsoft Office.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Copilot show code instead of a dice roll?

This happens due to a temporary backend rendering failure. Copilot fails to execute the internal random number generation function and instead outputs the raw syntax, such as {{random_int(1, 20)}}.

Does Copilot support advantage and disadvantage dice rolls?

Yes, when functioning correctly, Copilot can handle advantage rolls by rolling the die twice and automatically selecting the higher number for you in the chat output.

Is the /r 1d20 command officially supported in Copilot?

Copilot generally understands standard tabletop RPG dice notation like /r 1d20. However, if a parsing bug occurs, switching to plain language like 'roll a twenty-sided die' can sometimes serve as an effective workaround.