Post

Power fx Library for Copilot Studio

This blog curates practical scenarios where Power Fx expressions play a key role in Copilot Studio—demonstrating how they enable smarter logic, data handling, and automation within conversations and integrations. Over time, this library will grow with additional use cases, serving as a reference for practical applications

Power fx Library for Copilot Studio

alt text

Use Case #1: Create & Pass Records From Copilot Studio to Flows

Problem:

alt text

When calling a Power Automae flow (or Agent flow) from a topic in Copilot Studio, we will pass input variables of different data types that a Power Automate supports; which are text, file, email, number, date and boolean. When we try to pass a record data type which is a collection of key-value pairs, or a table data type which is a collection of records, the above error pops up. To solve this problem, we can use Powerfx functions Text() and JSON(). Let’s also look at how we create record and table structures and how to pass these to flows

Creating a record

An empty record data type can be created as simple as using the curly braces.

{} - Creates an empty record

Below is an example of a record data type. Variable and string literals can be used for values. If using string literals enclose them with double quotes. Here our variable name is “userRecord”. This variable in Powerfx expressions can be referenced using Topic.userRecord

1
2
3
4
5
{
    userName: System.User.DisplayName,
    userEmail: System.User.Email,
    language: System.User.Language
}

alt text

Pass a record type to Flow

Following expression can be used to pass a record data type to a flow inputs

1
Text(JSON(Topic.userRecord, JSONFormat.Compact))

This will convert a JSON record to JSON string, which a power automate flow can accept as a input parameter.

alt text

Retrieving Records in Flow

To retrieve the passed record from copilot studio in a power automate flow, pass the input JSON string to a Parse JSON and generate the schema from a sample. Doing this, you will be able to retirve the record values as below:

alt text

The same formula applies for table structures, the only difference when creating a table structure is to enclose collection of records using “[ ]”. Example below:

1
2
3
4
5
6
7
8
9
10
11
12
[
    {
        userName: "",
        userEmail: "",
        language: ""
    },
    {
        userName: "",
        userEmail: "",
        language: ""
    }
]

Sandeep Angara
August 23, 2025

This post is licensed under CC BY 4.0 by the author.