All - I created a power automate to run a SQL stored procedure. I have tested the flow and its pulling in data. I have the flow added into PowerApps and when I run it, you can see its running successful in power automate. I need to make a collection of this information. I have the following in the OnStart of the app as follows:
Set(myCollection, TPA_SP.Run(DatePickerStart.SelectedDate,DatePickerEnd.SelectedDate)
Would anyone know how I can get the data from this stored procedure into a collection? Thank you!
Solved! Go to Solution.
Hi @StinkyD01 ,
There are 2 methods.
1\ Use response action in flow. It will return an array from flow to canvas app, you can create a collection directly something like: ClearCollect(Col, flow.Run())
2\ Use ParseJson function in powerapps. Using this function, the canvas just need a json string coming from flow instead of an array.
https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-parsejson
Best Regards,
Wearsky
Thank you so much for responding to me. Your suggestions helped me. Plus, I'm using a Date Range too.
I was able to get this to work with the following:
Set(
varDatafromFlow,
TestStoredProcedure_Sorting.Run(
DatePickerStart.SelectedDate,
DatePickerEnd.SelectedDate
).response
);
Set(
varDataFlow,
ParseJSON(varDatafromFlow)
);
Then on my Gallery Items: Table(ParseJSON(varDatafromFlow))
Thank you again
Hi @StinkyD01 ,
There are 2 methods.
1\ Use response action in flow. It will return an array from flow to canvas app, you can create a collection directly something like: ClearCollect(Col, flow.Run())
2\ Use ParseJson function in powerapps. Using this function, the canvas just need a json string coming from flow instead of an array.
https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-parsejson
Best Regards,
Wearsky
Thank you so much for responding to me. Your suggestions helped me. Plus, I'm using a Date Range too.
I was able to get this to work with the following:
Set(
varDatafromFlow,
TestStoredProcedure_Sorting.Run(
DatePickerStart.SelectedDate,
DatePickerEnd.SelectedDate
).response
);
Set(
varDataFlow,
ParseJSON(varDatafromFlow)
);
Then on my Gallery Items: Table(ParseJSON(varDatafromFlow))
Thank you again
User | Count |
---|---|
256 | |
106 | |
92 | |
47 | |
37 |