Use Copilot to create and edit Power Fx formulas
Copilot is an AI feature in Power Apps Studio that helps you create and modify Power Fx formulas quickly. You can use Copilot in the formula bar to explain Power Fx formulas in natural language or generate Power Fx formulas from natural language or code comments.
Prerequisites
Copilot must be enabled for your environment and tenant. For more information, see Enable or disable Copilot (preview) in Power Apps.
Note
By default, the new formula bar is enabled. If the Copilot functionality menu isn't visible, check the following app settings in Power Apps Studio:
- On the command bar, select Settings > Updates.
- From the Retired tab, turn off the Legacy formula bar toggle.
Explain a formula
Use Copilot in the formula bar to understand what a formula is doing in plain language.
Select a control and its corresponding property.
On the formula bar, select the Copilot functionality menu > Explain this formula.
Copilot provides an explanation of the formula that you can copy and insert as a code comment or share with other makers who are working on the same app.
Known limitations of explaining formulas
- The maximum length of a formula explanation is 5,000 characters.
- Copilot only recognizes default properties in Power Apps.
- Copilot doesn't recognize user-defined functions.
Note
AI generated content may be inaccurate and should be checked for accuracy.
Generate formulas from code comments
Copilot can generate Power Fx formulas from code comments in the formula bar. You can accept the suggestion or type the formula yourself. Formula code comments can also serve as documentation for your formulas, just like regular code comments.
With your canvas app open for editing, type a code comment using
//
or/*
in the formula bar.Wait a few seconds for Copilot to generate a formula suggestion or press Enter to generate it immediately.
Press Tab on the keyboard to accept and use the suggested formula. You can also type through the suggestion.
The suggestion remains until you select elsewhere or type a character that doesn't match the suggestion.
You can keep the comments used for generating Power Fx formulas in the formula bar as documentation, similar to traditional code comments.
Note
- If Copilot doesn't provide a suggestion, then it couldn't generate a formula based on your comment. Try rephrasing the comment.
- We recommend enclosing in quotes the elements that you want to include in your formula, such as
"Button1.text"
.
Known limitations of generating formulas from code comments
- Copilot only recognizes default properties in Power Apps.
- Copilot doesn't recognize user-defined functions.
- Code comments only work with general Power Fx functions, and not Power Apps-specific functions such as
Navigate()
. - The advanced panel doesn't trigger suggestions.
- Existing formulas for the property aren't included in the suggestion.
Responsible AI
Understand the choices you have when working with AI. Learn more in FAQ about using AI responsibly in Power Apps. Review the Power Fx Copilot FAQ for questions about this feature specifically.
Language Support
The following table lists the languages available for the formula bar copilot features, which is based on the settings in your Power Platform environment and browser.
Name | Language Code | Functionality Supported |
---|---|---|
English | en-US | Explain a formula, Comment generated formulas |
Chinese (simplified) - China | zh-Hans | Explain a formula, Comment generated formulas |
Czech - Czech Republic | cs-CZ | Explain a formula, Comment generated formulas |
Danish - Denmark | da-DK | Explain a formula, Comment generated formulas |
Dutch - Netherlands | nl-NL | Explain a formula, Comment generated formulas |
Finnish - Finland | fi-FI | Explain a formula, Comment generated formulas |
French - France | fr-FR | Explain a formula, Comment generated formulas |
German - Germany | de-DE | Explain a formula, Comment generated formulas |
Greek - Greece | el-GR | Explain a formula, Comment generated formulas |
Italian - Italy | it-IT | Explain a formula, Comment generated formulas |
Japanese - Japan | ja-JP | Explain a formula, Comment generated formulas |
Korean - Korea | ko-KR | Explain a formula, Comment generated formulas |
Norwegian (Bokmål) - Norway | nb-NO | Explain a formula, Comment generated formulas |
Polish - Poland | pl-PL | Explain a formula, Comment generated formulas |
Portuguese - Brazil | pt-BR | Explain a formula, Comment generated formulas |
Russian - Russia | ru-RU | Explain a formula, Comment generated formulas |
Spanish (Traditional Sort) - Spain | es-ES | Explain a formula, Comment generated formulas |
Swedish - Sweden | sv-SE | Explain a formula, Comment generated formulas |
Thai - Thailand | th-TH | Explain a formula, Comment generated formulas |
Turkish - Türkiye | tr-TR | Explain a formula, Comment generated formulas |