Power Apps is Smarter: Copilot Comment-Generated Formulas

Blog post about Power Apps new Copilot comment-generated formulas

If you’ve been building Power Apps for a while, you know that moment when you need a specific formula but can’t quite remember the syntax. You know what you want to accomplish, but finding the right function or remembering the exact parameter order sends you scrambling to the documentation. Well, those days might be behind us thanks to Power Apps’ newest feature: Copilot comment generated formulas. This is my post and associated video.

What Exactly Is This New Feature?

The concept is simple. Instead of wrestling with complex formula syntax, you can now type a prompt as a comment in the formula box. Describe what you want your formula to do, hit enter, and watch as Copilot generates the Power Apps formula for you. It’s like having a Power Apps expert sitting next to you, translating your plain English descriptions into proper Power Fx code.

Here’s how it works: Go to any formula box in your Power App, start typing a comment (using the standard // syntax), describe what you want to accomplish, and press enter. Copilot will generate the appropriate formula based on your description. You can then press Tab to accept it or modify it as needed.

Getting Started: Where to Find Comment-Generated Formulas

Before you can start using this time-saving feature, you’ll need to enable it in your app settings. Navigate to Settings > Updates and look for Copilot comment-generated formulas. Just toggle it on and you’re ready to go.

Settings panel showing options for enabling Copilot comment-generated formulas in Power Apps.

One important note: this is NOT tied to your Microsoft 365 Copilot license. This is the built-in Copilot functionality that’s already available in Power Apps, so makers should be able to access it without additional licensing concerns.

Real-World Examples That’ll Make Your Life Easier

Conditional Formatting Made Simple

One of the most common use cases is conditional formatting in a gallery. Instead of manually typing out complex Switch statements for status colors, you can simply write something like: “green if new, blue if approved, orange if in progress, red if rejected.”

Power Apps formula box displaying a comment with conditions for color coding: 'green if New, blue if Approved, orange if In Progress', with a message indicating that the formula is being generated.

Copilot instantly generates a proper Switch function with all the right syntax. What’s impressive in this example, is that it knows when to use Switch versus nested If statements, choosing the most efficient approach for your specific scenario. Here’s what it came up with:

// green if 'New', blue if 'Approved', orange if 'In Progress' Switch statement code example in Power Apps.

Dynamic Visual Properties

Font formatting becomes effortless too. Want to make text bold when a price exceeds a certain threshold? Just type: “make the font bold if the price is greater than 1000, otherwise normal.” Copilot generates the proper If statement and applies it to the FontWeight property.

A formula input box in Power Apps showing the conditional formatting to make text bold if the price exceeds 1000, otherwise normal.

Want to highlight rows based on priority? In the TemplateFill property, write: “highlight row light yellow if priority is high, otherwise white smoke.

Gallery Magic with Comment-Generated Formulas

With galleries, not only can you use the above conditional formatting formula ideas, you can create formulas on your items property. For filtering, you can write something like: “filter purchase requests by just the ones where the created by is the current user.” Copilot understands the context and generates the appropriate Filter function with the correct field references.

Date Calculations Without the Headache

Date formulas are notorious for giving Power Apps developers headaches. But with Copilot, you can write: “calculate the number of days since created” and it’ll generate a proper DateDiff function. No more hunting through documentation to remember the exact syntax for date calculations.

Advanced Scenarios with Comment-Generated Formulas

The feature handles surprisingly complex scenarios too. Want to combine filtering and sorting? You can write: “filter purchase requests that are approved and sort by amount highest first.” Copilot will properly nest the Sort function around the Filter function, handling all the comma placement and parameter ordering that typically trips people up.

Power Apps formula editor showing a formula for sorting approved purchase requests by amount, with components labeled as 'Tree view' and 'Items'.

Dynamic form behavior is another area where this shines. Making form fields appear or disappear based on other selections becomes as simple as writing: “show if priority dropdown has high selected.” on a form card’s visible property. Here is the result of a few of the formulas demonstrated in the video below, with conditional formatting on the price, status and row color. There’s even a drop-down box to select the status, with the formula in the gallery written by Copilot, to filter based on the status picked.

A purchase request list displayed in a Power Apps interface, showing columns for title, department, description, quantity, price, vendor, and status. The row for 'Stapler' is highlighted in yellow and marked as 'Rejected'.

The Learning Curve: What You Still Need to Know

While this feature is incredibly powerful, it’s not quite a beginner’s tool. You still need to understand Power Apps fundamentals – knowing which control to select, which property to modify, and how different controls interact. Think of it as a sophisticated shortcut for people who already know their way around Power Apps, rather than a replacement for learning the platform.

You’ll still need to know when to go to the Items property of a gallery for filtering, or the Visible property of a control for conditional display logic. The feature accelerates your development once you’re in the right place, but it doesn’t eliminate the need to understand Power Apps fundamentals.

Tips for Getting the Most Out of Comment-Generated Formulas

Start simple and build complexity gradually. If you’re working on a complex formula, try getting the basic version working first, then add layers of complexity. Copilot tends to handle straightforward requests more reliably than overly complex multi-part descriptions.

Be specific with control names. If your prompt references other controls, make sure you’re using their actual names in your description. Copilot can’t read your mind about which dropdown or button you’re referring to.

Don’t be afraid to iterate. If the first generated formula isn’t quite right, you can modify your prompt and try again. Sometimes a slight rewording gets you exactly what you need.

A Word of Caution

While this feature is incredibly helpful, keep an eye on delegation warnings, especially when working with large datasets. Copilot might generate formulas that work functionally but aren’t optimized for performance with large data sources. Always test with realistic data volumes.

Also, remember that you might want to toggle this feature off if you’re just trying to add regular comments to your code without triggering formula generation.

The Bottom Line

Copilot comment generated formulas represents a significant step forward in making Power Apps development more accessible and efficient. For experienced developers, it’s a massive time-saver that eliminates the tedious lookup of syntax and function names. For intermediate users, it’s an excellent learning tool that shows proper formula construction while solving real problems.

This isn’t going to replace the need to understand Power Apps concepts, but it’s absolutely going to change how we build apps. Instead of spending time researching the syntax, we can focus on the logic and user experience – which is exactly where our energy should be spent.

The feature is available now, so go ahead and toggle it on in your next app.

Here is my associated demonstration video:

Microsoft's documentation on this:

https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/ai-formulas-formulabar

3 comments

Leave a Reply