I use Flow to run a SQL Server stored procedure (on-prem), then I need the result to display in PowerApps.
Following this article (Return an Array from Flow to PowerApps (Response Method), I get the right result in Flow, but PowerApps collection cannot get the same result.
PowerApps collection gets always "True".
Flow :
Result of Flow :
PowerApps :
When click on a button, send variable and then run Flow
Stored procedure
ALTER procedure [dbo].[ByMail] @mail as varchar(50) as SELECT TOP 10 [ID] ,[DATE] ,[Hour] ,[User] ,[Email]
FROM [dbo].[Request] where EMail = @mail
Solved! Go to Solution.
Hi @AnnaCICI_Z,
Could you please expand the "Response" action within your flow?
Do you mean that the _demandeTable collection only return true?
I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:
Flow's configuration:
Within the "Response" action, set the Body field to following:
body('Execute_stored_procedure')?['ResultSets']?['Table1']
Set the Response Body JSON Schema field to following:
{ "type": "array", "items": { "type": "object", "properties": { "Id": { "type": "integer" }, "EmpName": { "type": "string" }, "EmpEmail": { "type": "string" }, "EmpDept": { "type": "string" } }, "required": [ "Id", "EmpName", "EmpEmail", "EmpDept" ] } }
The flow executes successfully as below:
App's configuration:
Set the OnSelect property of the "Collection" button to following:
ClearCollect(RecordsCollection,'20181224_case2'.Run("PowerApps"))
The RecordsCollection as below:
The user @doubles has also faced same issue with you, please check my response within the following thread:
Please check if you have typed proper formula within the Body field of the "Response" action in your flow.
In addition, please also check if you have typed proper Response Json Schema within the Response Body JSON Schema field of the "Response" action.
If the issue still exists, please consider take a try to re-create your flow based on above solution I provided, then re-create a new connection within your app, trigger your flow again from your app, check if the issue is solved.
Best regards,
Kris
Hi Kris, I found why I cannot get the right result in PowerApps.
Because PowerApps cannot update the modifications of Flows automatically, I should switch flows in PowerApps for getting the last version.
Hi @AnnaCICI_Z,
Could you please expand the "Response" action within your flow?
Do you mean that the _demandeTable collection only return true?
I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:
Flow's configuration:
Within the "Response" action, set the Body field to following:
body('Execute_stored_procedure')?['ResultSets']?['Table1']
Set the Response Body JSON Schema field to following:
{ "type": "array", "items": { "type": "object", "properties": { "Id": { "type": "integer" }, "EmpName": { "type": "string" }, "EmpEmail": { "type": "string" }, "EmpDept": { "type": "string" } }, "required": [ "Id", "EmpName", "EmpEmail", "EmpDept" ] } }
The flow executes successfully as below:
App's configuration:
Set the OnSelect property of the "Collection" button to following:
ClearCollect(RecordsCollection,'20181224_case2'.Run("PowerApps"))
The RecordsCollection as below:
The user @doubles has also faced same issue with you, please check my response within the following thread:
Please check if you have typed proper formula within the Body field of the "Response" action in your flow.
In addition, please also check if you have typed proper Response Json Schema within the Response Body JSON Schema field of the "Response" action.
If the issue still exists, please consider take a try to re-create your flow based on above solution I provided, then re-create a new connection within your app, trigger your flow again from your app, check if the issue is solved.
Best regards,
Kris
Hi Kris, thank you very much.
I double check my Flow and my PowerApps button, I did exactly as you said. But I always get "True" in my RecordsCollection.
In your PowerApps, how do you configure your recordsCollection ? Just use "ClearCollect" ?
Hi Kris, I found why I cannot get the right result in PowerApps.
Because PowerApps cannot update the modifications of Flows automatically, I should switch flows in PowerApps for getting the last version.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
203 | |
187 | |
82 | |
50 | |
37 |
User | Count |
---|---|
290 | |
244 | |
123 | |
74 | |
54 |