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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / BUG: Variables or Expr...
Copilot Studio
Answered

BUG: Variables or Expressions in Custom Instructions property for Generative Answers node

(0) ShareShare
ReportReport
Posted on by 37

In the Custom Instructions property for Generative Answers node, if you use variables or powerFx expressions instead of a static plain text then it is buggy and does not work.

 

How to reproduce: start with a working Custom Instructions which uses static plain text. Then set a new variable whose content is this exact same plain text. Now use the variable as sole input for the Custom Instructions. Now it doesn't work the same as expected.

 

There you have two afternoons wasted on buggy software without warnings...

Categories:
I have the same question (0)
  • Verified answer
    adilei Profile Picture
    Microsoft Employee on at

    There is a way to work around this issue. Let's say you want the copilot to address users by their names. In custom instructions, you can provide the following prompt:

     

    adilei_0-1706862946206.png

     

    Once the instructions are set, click on the three dots on the top right corner, and then "Open code editor"

     

    adilei_1-1706863048217.png

    In code view, you can see the variable Topic.userName is surrounded by two pairs of curly brackets. This is why the variable name is treated as hardcoded text. remove one pair of curly brackets and save the topic.

     

    Before editing the code

     

     - kind: SearchAndSummarizeContent
     id: search-content
     userInput: =System.Activity.Text
     variable: Topic.Answer
     additionalInstructions: "whenever providing an answer, say: I hope this helps, {{Topic.userName}} "
     publicDataSource:
     sites:
     - "https://www.metacritic.com/"

     

    After editing the code

     

     - kind: SearchAndSummarizeContent
     id: search-content
     userInput: =System.Activity.Text
     variable: Topic.Answer
     additionalInstructions: "whenever providing an answer, say: I hope this helps, {Topic.userName} "
     publicDataSource:
     sites:
     - "https://www.metacritic.com/"

     

    With only a single pair of curly brackets the variable will be parsed as expected, and used while providing an answer:

     

    adilei_2-1706863337624.png

     

  • OOO1337777 Profile Picture
    37 on at

    OK.

     

    Another question: How does the Custom Instructions take effect:

    - before the Search (thereby instructing how to search and synthesizing a new query string) or

    - after the Search (thereby to synthesize an answer from the search results on the plain query string input)?

     

    By the way I read this comment from another post on this forum... all these details and info (and BUGs) should be manifest visible on the doc of Copilot Studio:

     

    -----

    Are you using your model on your company data ? If this is the case, maybe the problem doesn't stem from you model but from your indexing. When testing models in Azure AI studio, by default you use keyword search for your indexing but in copilot studio, the default is "simple" which works kinda weirldy (https://learn.microsoft.com/en-us/azure/search/query-simple-syntax) (and the complete documentation https://learn.microsoft.com/en-us/rest/api/searchservice/preview-api/search-documents ).

    In order to improve results, the best way to improve results is to use semantic search in azure ai search (https://learn.microsoft.com/en-us/azure/search/semantic-how-to-enable-disable?tabs=enable-portal ).

  • HenryJammes Profile Picture
    Microsoft Employee on at

    Bugs -- ie product issues -- should be fixed, not documented. To help on that front you can raise support request here: Get Help + Support in Power Platform - Power Platform | Microsoft Learn

     

    On the custom instructions piece, they apply after the content retrieval steps and apply when the summarization is done, so they mostly have an effect on formatting, tone of voice, etc.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 599

#2
chiaraalina Profile Picture

chiaraalina 170 Super User 2026 Season 1

#3
deepakmehta13a Profile Picture

deepakmehta13a 118

Last 30 days Overall leaderboard