cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stapes
Impactful Individual
Impactful Individual

Run failed: The data returned in the response is invalid.

I am wasting a lot of time retyping formulas because these errors keep appearing. I have made no changes since it previously worked. All I am doing is re-opening for editing.

Returning no data from a query in a previous test run is not an error!

The buttons highlighted in the picture refer to a formula that is invoked OnSelect:

 

ClearCollect(outstandingOrders, GoodsInToday.Run(WeekNo, SelectedYear, 3))

 

The AppChecker says these runs failed. They did not fail. They simply returned no data.

spurious-errors.png

 

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @stapes ,

I suggest you add if statement to justify whether returning blank value to avoid this problem.

Try this formula:

If(!IsEmpty(GoodsInToday.Run(WeekNo, SelectedYear, 3)&&
   !IsBlank(GoodsInToday.Run(WeekNo, SelectedYear, 3),
   ClearCollect(outstandingOrders, GoodsInToday.Run(WeekNo, SelectedYear, 3))

 

 

Best regards, 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

stapes
Impactful Individual
Impactful Individual

I finally found an elegant solution for this that worked!

I added an extra flow calling a new Stored Procedure that just gets the record count first.

ClearCollect(
    RowCount,
    IPL_Count_DeliveryDetail.Run(
        Selection.thOurRef,
        Selection.stCode
    )
);
UpdateContext({Counter: First(RowCount).rowcount});
If(
    Counter > 0,
    ClearCollect(
        DeliveryDetailCollection,
        IPL_GoodsInBatchDeliveries.Run(
            SelectedOrderItem.thOurRef,
            Selection.stCode
        )
    ),
    Clear(DeliveryDetailCollection)
);

No more spurious error message!

View solution in original post

3 REPLIES 3
v-yutliu-msft
Community Support
Community Support

Hi @stapes ,

I suggest you add if statement to justify whether returning blank value to avoid this problem.

Try this formula:

If(!IsEmpty(GoodsInToday.Run(WeekNo, SelectedYear, 3)&&
   !IsBlank(GoodsInToday.Run(WeekNo, SelectedYear, 3),
   ClearCollect(outstandingOrders, GoodsInToday.Run(WeekNo, SelectedYear, 3))

 

 

Best regards, 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
stapes
Impactful Individual
Impactful Individual

Have accepted this solution with reservations. It did not solve the problem. The error message persists. Instead of running the flow once, it now gets run three times for no tangible benefit.

stapes
Impactful Individual
Impactful Individual

I finally found an elegant solution for this that worked!

I added an extra flow calling a new Stored Procedure that just gets the record count first.

ClearCollect(
    RowCount,
    IPL_Count_DeliveryDetail.Run(
        Selection.thOurRef,
        Selection.stCode
    )
);
UpdateContext({Counter: First(RowCount).rowcount});
If(
    Counter > 0,
    ClearCollect(
        DeliveryDetailCollection,
        IPL_GoodsInBatchDeliveries.Run(
            SelectedOrderItem.thOurRef,
            Selection.stCode
        )
    ),
    Clear(DeliveryDetailCollection)
);

No more spurious error message!

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (4,351)