What is Power Fx?
Power Fx is the formula language used in Power Apps. It works like Excel formulas. You use it to:
- Show or hide buttons
- Filter data
- Do calculations
- Show messages
- Automate logic in your app
What is Copilot in Power Apps?
Copilot is an AI helper built into Power Apps. You can type what you want in plain English, and Copilot will write the Power Fx formula for you. It can also:
- Explain what a formula does
- Help fix a formula
- Make your formulas better
Prerequisites
Copilot must be enabled for your environment and tenant. For more information.
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. For example, a label control with its Text property.
- On the formula bar, select the dropdown near the fx field label to see and choose Explain this formula.
![Explain the formula]()
Alternatively, you can select a subset of a formula and then select the dropdown near the fx field label and choose Explain this selection to explain only that part.
![Tree view]()
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. When Copilot explains a selection, it might add context if that's important for the explanation.
![Formula explanation]()
Limitations
- The maximum length for a formula explanation is 5,000 characters. If the formula exceeds this limit, use a partial explanation to ensure it works.
- Copilot only recognizes default properties in Power Apps.
- Copilot doesn't recognize user-defined functions.
- 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.
![ufb Comment copilot]()
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 suggestions.
![ufb Commentfx Copilot]()
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.
Limitations of generating formulas from code comments
- Copilot works on a singular control and property, and it doesn't make changes to other controls or properties to achieve the desired outcome.
- Copilot doesn't take existing formula text into account.
- 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.
Create a formula (preview)
Note
The Copilot for formulas feature is turned on by default. To turn it off, you can find the setting with your app open. Go to Settings/Updates/Preview and find the Copilot for formulas toggle. Turning the setting off makes the Create a formula (preview) menu option disappear from the Copilot dropdown menu of the formula bar.
Use Copilot to create a formula from a discrete request
- Select a control, like a Text label, and its corresponding property, such as Text.
- On the formula bar, select the Copilot functionality menu > Create a formula.
![Create a formula]()
- In the Copilot text box, type your request, such as show today's day of the week.
- Select the Create arrow to submit your request.
- Copilot attempts to create a formula. Select Apply to insert the formula in the same position as the Copilot interface, or update and resumbit your request.
![Apply]()
Output
![Output]()
Conclusion
Copilot in Power Apps makes working with Power Fx simple and fast, even if you’re not a coding expert. You can just describe what you want in plain English, and Copilot writes the formula for you. It helps with creating, fixing, and improving your formulas so you can build better apps with less effort.
Whether you're filtering data, showing messages, or automating actions, Copilot saves you time and helps you learn as you go. It's a smart tool that makes app development easier and more powerful for everyone.