I wrote this simple identical code in a Functions V1 code repo and a Functions V2 code repo. Like described in your Documentation
interface SalesData {
region: string;
year: string;
productType?: string;
values: {
totalSales: Integer;
}
};
@Function()
public testPivotExpandableNew(): SalesData[] {
return [
{
"region": "NA",
"year": "2021",
"values": {
"totalSales": 30000
}
},
{
"region": "NA",
"year": "2021",
"productType": "Clothing",
"values": {
"totalSales": 90000
}
},
{
"region": "NA",
"year": "2021",
"productType": "Electronics",
"values": {
"totalSales": 150000
}
},
{
"region": "NA",
"year": "2021",
"productType": "Furniture",
"values": {
"totalSales": 60000
}
}
];
}
The Function Published by the V1 repo renders the correct result while the V2 version wont show the totals:
Please let me know if I did something wrong here or if it’s really a bug.