Power Automate Body/Value Expression

 In Power Automate, the expression

output('List_rows_1')?['body/value']

(or equivalently outputs('List_rows_1')?['body/value'])
is used to extract the data rows returned by a "List rows" action from Dataverse, SharePoint, or another connector that returns a list of items.

Let’s break it down πŸ‘‡

πŸ” Explanation of Each Part

PartMeaning
outputs('List_rows_1')Refers to the entire output (JSON) of the action named List_rows_1. The action name can differ (e.g., List_rows, List_records, etc.)
?Safe navigation operator — prevents errors if that property doesn’t exist.
['body/value']Accesses the array of records in the response body — i.e., all the rows returned by the List Rows action.

🧩 Example

Suppose your List rows action (List_rows_1) retrieves contact records from Dataverse.
The raw output might look like this (simplified):

{ "body": { "value": [ { "fullname": "John Doe", "emailaddress1": "john@contoso.com" }, { "fullname": "Jane Smith", "emailaddress1": "jane@contoso.com" } ] } }

Then this expression:

outputs('List_rows_1')?['body/value']

returns:

[ { "fullname": "John Doe", "emailaddress1": "john@contoso.com" }, { "fullname": "Jane Smith", "emailaddress1": "jane@contoso.com" } ]

That’s an array of objects — one per row retrieved.


🧠 Common Use Cases

  • In an “Apply to each” loop:

    Apply to each: value = outputs('List_rows_1')?['body/value']

    → This loops over every record returned.

  • To get a specific field from the first row:

    first(outputs('List_rows_1')?['body/value'])?['fullname']


🧩 Example Setup

Let’s say your List rows action (List_rows_1) retrieves records from a Dataverse table (like Contacts), and its output looks like this:

{ "body": { "value": [ { "fullname": "John Doe", "emailaddress1": "john@contoso.com", "contactid": "12345" }, { "fullname": "Jane Smith", "emailaddress1": "jane@contoso.com", "contactid": "67890" } ] } }

Now, here’s how you can extract values from it πŸ‘‡


🎯 1. Get All Rows (Array)

To get all rows:

outputs('List_rows_1')?['body/value']

This returns an array of records (like above).


🎯 2. Get the First Row

To get only the first record:

first(outputs('List_rows_1')?['body/value'])

This returns:

{ "fullname": "John Doe", "emailaddress1": "john@contoso.com", "contactid": "12345" }

🎯 3. Get a Specific Column Value

To extract a specific field from that first record:

Field You WantExpression
Full Namefirst(outputs('List_rows_1')?['body/value'])?['fullname']
Emailfirst(outputs('List_rows_1')?['body/value'])?['emailaddress1']
Contact IDfirst(outputs('List_rows_1')?['body/value'])?['contactid']

🎯 4. Get a Field from a Specific Record in a Loop

If you use an Apply to each action:

Apply to each: value = outputs('List_rows_1')?['body/value']

Inside the loop, you can access each field using:

FieldExpression inside the loop
Full Nameitems('Apply_to_each')?['fullname']
Emailitems('Apply_to_each')?['emailaddress1']
Contact IDitems('Apply_to_each')?['contactid']

⚡ Quick Tip

If you renamed your loop, replace 'Apply_to_each' with the actual loop name — for example:

items('Apply_to_each_2')?['fullname']

Would you like me to show how to filter or pick a specific row (for example, the one where email = "john@contoso.com")?



Comments

Popular posts from this blog

πŸ” Dataverse + Azure Integration: Choosing Between Synapse Link and Microsoft Fabric

⚡ Example: Rate Limiting in Azure API Management

In-Process vs Isolated Process Azure Functions: What’s the Difference?