cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frosty8467
Regular Visitor

Collection isn't storing data received from a flow

I have a flow that connects to an on premise gateway and retrieves data based on two parameters.

In my Power app on a forms on visible  I have the following code.

 

If(Connection.Connected,
ClearCollect(ManifestDetails,GetManifestDetails.Run(First(LocalDataCollection).UserLogin,Text(DatePicker1.SelectedDate,"yyyy-mm-dd")));
SaveData(ManifestDetails,"SavedDetails");
ClearCollect(Manifest, GroupBy(ManifestDetails, "Id","PickupDate", "Orders"));
Set(Online, "Hello Date Picker"),
Set(Online, "You are currently offline and cannot refresh this screen")
)

 

The flow is called as I can see it has run successfully in the run log but the data returned is not saved in to the collection called ManifestDetails.

 

I have copied the result of the flow and created the following code for on visible and this works.
If(Connection.Connected,
ClearCollect(ManifestDetails,
{Id: 1,
PickupDate: "2021-11-24T00:00:00",
OrderID: 1,
PickUpAddress1: "24 Ravello Rise ",
PickUpAddress2: "Flat Bush",
PickUpCity: "Auckland",
DeliveryName: "Test Company",
DeliveryPhone: "",
DeliveryMobile: "",
DeliveryAddress1: "25 Ravello Rise",
DeliveryAddress2: "Flat Bush",
DeliveryCity: "Auckland",
ApplicationUserID: "09ad1ff9-a64b-4503-9858-956333e27812",
OrderStatus: "placed",
ItemName: "Test Item",
ItemDescription: "This is a Test Item",
Length: 1,
Width: 1,
Depth: 1,
Weight: 10,
Quantity: 2,
LineStatus: "",
OrderDetailsId: 1
},
{
Id: 1,
PickupDate: "2021-11-24T00:00:00",
OrderID: 2,
PickUpAddress1: "24 Ravello Rise",
PickUpAddress2: "Flat Bush",
PickUpCity: "Auckland",
DeliveryName: "Test Company",
DeliveryPhone: "",
DeliveryMobile: "",
DeliveryAddress1: "26 Ravello Rise",
DeliveryAddress2: "Flat Bush",
DeliveryCity: "Auckland",
ApplicationUserID: "09ad1ff9-a64b-4503-9858-956333e27812",
OrderStatus: "placed",
ItemName: "Test Insert",
ItemDescription: "Test Insert",
Length: 1,
Width: 1,
Depth: 1,
Weight: 1,
Quantity: 10,
LineStatus: "",
OrderDetailsId: 2
});
Set(Online, "Hello");
SaveData(ManifestDetails,"SavedDetails");
ClearCollect(Manifest, GroupBy(ManifestDetails, "Id","PickupDate", "Orders"));
Set(Online, "Hello 2");,
Set(Online, "You are currently offline and cannot refresh this screen")
)

 

So what have I missed in when calling the flow?

 

Thanks in advance.

 

Matt

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Super User
Super User

Hi @Frosty8467 

 

I see the code that calls the flow. Does the Power Automate returns the data using the "Respond to PowerApps or Flow" step like below

 

Here is a sample flow which called from PowerApps

StalinPonnusamy_0-1636085922240.png

 

Call Flow with Param and store the response back to Collection

 

 

ClearCollect(ColSQLReturn , CallFromPowerApps.Run("Param1").spresponse)

 

 

Data Flow

PowerApps --> Power Automate --> SQL --> Power Automate --> Power Apps


Thanks,
Stalin - Learn To Illuminate

View solution in original post

3 REPLIES 3
StalinPonnusamy
Super User
Super User

Hi @Frosty8467 

 

I see the code that calls the flow. Does the Power Automate returns the data using the "Respond to PowerApps or Flow" step like below

 

Here is a sample flow which called from PowerApps

StalinPonnusamy_0-1636085922240.png

 

Call Flow with Param and store the response back to Collection

 

 

ClearCollect(ColSQLReturn , CallFromPowerApps.Run("Param1").spresponse)

 

 

Data Flow

PowerApps --> Power Automate --> SQL --> Power Automate --> Power Apps


Thanks,
Stalin - Learn To Illuminate

Stalin,

 

thanks for the reply not exactly what I needed but it did get me on the right track.

 

Thanks again

 

Matt

Hi,

 

may i know if you able to solve your problem,

i having similar problem where i expecting result from flow run to be store in collection, but didn't.

 

Collect(platformspare,DropColumns(AddColumns(Distinct('Main Power Apps Database',field_6),"CountPart", Value(getCountRev1.Run("..",ThisRecord.Result).total_items), "Title",ThisRecord.Result), "CountPart"));

azrimahanif_1-1659514602381.png

 

 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,963)