diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ForeachExecutorTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ForeachExecutorTest.cs
index adfa0babe2..b3b16f149b 100644
--- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ForeachExecutorTest.cs
+++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/ForeachExecutorTest.cs
@@ -202,6 +202,35 @@ public sealed class ForeachExecutorTest(ITestOutputHelper output) : WorkflowActi
Assert.Equal(1m, currentValue.ToObject());
}
+ ///
+ /// Single-field records whose only field is NOT named Value are not Power Fx auto-wraps;
+ /// they are preserved as records so the field name remains accessible inside the loop body.
+ ///
+ [Fact]
+ public async Task ForeachTakeNextWithSingleFieldNonValueRecordAsync()
+ {
+ // Arrange
+ const string CurrentValueName = "CurrentValue";
+ this.SetVariableState(CurrentValueName);
+
+ TableDataValue tableValue = DataValue.TableFromRecords(
+ DataValue.RecordFromFields(new KeyValuePair("name", new StringDataValue("Alice"))));
+
+ Foreach model = this.CreateModel(
+ displayName: nameof(ForeachTakeNextWithSingleFieldNonValueRecordAsync),
+ items: ValueExpression.Literal(tableValue),
+ valueName: CurrentValueName,
+ indexName: null);
+ ForeachExecutor action = new(model, this.State);
+
+ // Act
+ await this.ExecuteAsync(action, ForeachExecutor.Steps.Next(action.Id), action.TakeNextAsync);
+
+ // Assert
+ RecordValue currentValue = Assert.IsType(this.State.Get(CurrentValueName), exactMatch: false);
+ Assert.Equal("Alice", currentValue.GetField("name").ToObject());
+ }
+
[Fact]
public async Task ForeachTakeLastAsync()
{