Skip to content

.NET: [.NET] Fix Declarative Foreach dropping multi-field record values (fixes #6183)#6185

Open
hanhan761 wants to merge 1 commit into
microsoft:mainfrom
hanhan761:case32-fix-foreach-record
Open

.NET: [.NET] Fix Declarative Foreach dropping multi-field record values (fixes #6183)#6185
hanhan761 wants to merge 1 commit into
microsoft:mainfrom
hanhan761:case32-fix-foreach-record

Conversation

@hanhan761
Copy link
Copy Markdown

Summary

Fix \ForeachExecutor\ that collapsed multi-field records to only the first field's value in the loop value variable.

Changes

  • \ForeachExecutor.cs\ line 52: \�alue.Properties.Values.First().ToFormula()\ → \�alue.ToFormula()\

Issue

Fixes #6183

Verification

The existing tests in \ForeachExecutorTest.cs\ only build records with a single field, so they didn't catch this bug. The fix preserves the original behavior for single-field records while also correctly keeping all fields for multi-field records.

Copilot AI review requested due to automatic review settings May 30, 2026 06:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the ForeachExecutor to convert each table row directly to a formula value rather than extracting the first property's value before conversion.

Changes:

  • Replaced value.Properties.Values.First().ToFormula() with value.ToFormula() when materializing values from a TableDataValue.

@moonbox3 moonbox3 added .NET workflows Related to Workflows in agent-framework labels May 30, 2026
@github-actions github-actions Bot changed the title [.NET] Fix Declarative Foreach dropping multi-field record values (fixes #6183) .NET: [.NET] Fix Declarative Foreach dropping multi-field record values (fixes #6183) May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET workflows Related to Workflows in agent-framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET: [Bug]: Declarative Foreach collapses multi-field records to their first field in the loop value variable

3 participants