@Anonymous
The answer is fairly simple, you just have to insure there is a record returned from your stored procedure. You can do this by adding an UNION ALL SELECT statement to your Select query, returning a row with only NULLS. Null should be matching the columns in the select statement.
Basically Flow gets at least one record and so has the schema and the result to return, so the error won't occur.
Then in PowerApps you remove the last row with this formula.
ClearCollect(YourCollection, YourFlow.Run())
;Remove(YourCollection, Last(YourCollection))
Leaving an empty well structured collection, when you don't have records returned.
Made a video on this topic, see Learn PowerApps | 22 | PowerApps - Flow - SQL Server - import Dynamic Data
Btw: You just have to use three components: PowerApps, SQL, Request.
A nice trick for when the ResultSet.Table1 is not in your dynamic options for the request is to:
- go to the custom editor
- put in a letter
- go back to the dynamic results
- Pick the ResultSet
- go back and delete the letter
- add ?['Table1']
Hope this helps,
Paul