I have a canvas app connecting to sql server. My proc returns data. It's a simple "select * from myTable" query and has nothing fancy about it. No temp tables, cursors, etc.
When in the the PowerFx window, trying to call the procedure, the Intellisense works until after the ".Resultsets" and then errors out when I add ".Table1". Do you know why a simple "select * from myTable" doesn't work?
I found a workaround (see article
View results in SQL Server - Power Apps | Microsoft Learn). But I'm puzzled why I'd have to resort to this to get it to work. See the "Untyped Results" paragraph:
"Some complicated stored procedures return untyped results. This result is common for stored procedures that use temporary tables. Power Apps can't easily determine the results ahead of time. Therefore, the return is marked as untyped and you can't access these results directly. You must first provide a type."
==== WORKAROUND========
Set(
MyUntypedObject, // pull results into variable
MyDB.dboprocPowerAppDemo().ResultSets
);
Set(
table1, // put Table1 into table1
MyUntypedObject.Table1
);
Set(
ResultSet,
ForAll(
table1, // extract JSON from table1
{
OrderNumber: Text(ThisRecord.'Order Number'),
ItemNo: Text(ThisRecord.'Item No.'),
UnitOfMeasure: Text(ThisRecord.UnitofMeasure),
}
)
);
thanks!