When building advanced agents in Copilot Studio, mastering Power Fx is essential. Unlike standard configuration, using Power Fx formulas allows for complex logic, data manipulation, and precise variable control.
This guide serves as a cheat sheet for using Power Fx in Copilot Studio, covering undocumented functions, variable prefixes, and array handling quirks.
Power Fx in Copilot Studio Overview
Available Functions & Hidden Gems
Official documentation: Common Power Fx formulas
Operators & String Interpolation
Using string interpolation syntax (e.g., `$”Hello {Name}”`) can be unreliable or cause errors. This is likely because Copilot Studio’s underlying YAML definition uses a similar syntax for variable embedding. Stick to the `Concatenate` function or `&` operator for safety.
Writing Complex Formulas
Example: Generating a table of squared values greater than 6 from the first 10 numbers.
Cheat Sheet: Variable Prefixes
When accessing variables inside a Power Fx formula, you must add the correct prefix. This is different from Power Apps.
| Variable Type | Prefix | Example |
|---|---|---|
| Topic Variable | Topic. |
Topic.UserName |
| Global Variable | Global. |
Global.TotalCount |
| System Variable | System. |
System.ConversationId |
| Environment Variable* | Env. |
Env.SiteUrl |
*Environment variables (Env.) are not officially documented but often work.
⚠️ Important: Handling Arrays
Just like in Power Apps, Power Fx in Copilot Studio treats arrays as Single Column Tables. This is a common pitfall for developers coming from other languages.
[{Value: 1}, {Value: 2}, {Value: 3}]You must reference the item using .Value.
Using Comments

コメント