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

Dealing with Runtime errors in a Canvas App

My canvas app is showing a run time error from a previous run when I open it to edit.

It is showing an error for this statement:

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

In the first place, this should not be flagged as an error. No data is NOT an error. It just means no records were found. This is a normal occurrence.

How can these spurious errors be handled / eliminated.

I do not need our users seeing big red errors for no reason.

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @stapes

Do you mean that if your flow returns blank value, the formula will show error?

If so, I suggest you try if statement to avoid this.

Try this formula:

If(!IsBlank(GoodsInToday.Run(WeekNo, SelectedYear, 2))||
   !IsEmpty(GoodsInToday.Run(WeekNo, SelectedYear, 2)),
   ClearCollect(outstandingOrders,GoodsInToday.Run(WeekNo, SelectedYear, 2)
  )

In this way, if the flow returns nothing, the clearcollect action will not perform.

 

 

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

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

Hi @stapes

Do you mean that if your flow returns blank value, the formula will show error?

If so, I suggest you try if statement to avoid this.

Try this formula:

If(!IsBlank(GoodsInToday.Run(WeekNo, SelectedYear, 2))||
   !IsEmpty(GoodsInToday.Run(WeekNo, SelectedYear, 2)),
   ClearCollect(outstandingOrders,GoodsInToday.Run(WeekNo, SelectedYear, 2)
  )

In this way, if the flow returns nothing, the clearcollect action will not perform.

 

 

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

Using this formula:

If(!IsBlank(GoodsInToday.Run(WeekNo, SelectedYear, 2))||
   !IsEmpty(GoodsInToday.Run(WeekNo, SelectedYear, 2)),
   ClearCollect(outstandingOrders,GoodsInToday.Run(WeekNo, SelectedYear, 2)
  )

Doesn't this involve running the flow 3 times?

Sytze
Frequent Visitor

Twice. Once for the condition and once for either the True or the False part of the conditional stetement.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,567)