Showing results for 
Search instead for 
Did you mean: 
New Member

Using a countrows function inside an if statement

Hi everyone


I have a form and gallery on one screen. There is an add form button which works fine and you can add and delete forms perfectly but I want a new form to show up as soon as the last record is deleted from the gallery.


In my Delete Record Button's OnSelect my code looks like this:


If(CountRows(Gallery.AllItems) = 0, ResetForm(Form);NewForm(Form))


I thought this would work as its checks if the gallery is empty each time a record is deleted but it does not work.


I think there is a problem with my

ResetForm(Form);NewForm(Form)) part of code


Any Help would be appriciated.


Resolver I
Resolver I

Hi @jaja4114 ,

I believe you have to post this question in Forums - Power Platform Community (

as it is about Canvas app questions.


Hoping it helps.


Helpful resources

Carousel Community Blog

Check out the Community Blog

Read all about the most recent blogs in the community!

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Carousel News & Announcements

What's New in the Community?

Check out the latest News & Events in the community!

Top Solution Authors
Users online (2,955)