cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShanP
Advocate II
Advocate II

Count rows for specific cell

I have a app where a new user or existing user can enter data into a form. If they are an existing user, it is sorted by their last name and then all forms they have created are viewed. If they are a new user, they can create a new user in the system, but they don't have an pre existing data, so there is no point for them to go to the page where all the forms are viewed. I would like to send them straight to the form creation page.

 

So the users are sorted by name in a column "User." When a new user is created, a row is automatically made in my excel file, the only cell filled in that row is under the column "User," whereas every other cell is empty. Is there a way I can sort or filter this, so that if the user is new and the only cell filled is their name, that I can send them straight to a specific page?

 

I was thinking of maybe using a combination of isBlank or countrows but I can't figure it out.

3 ACCEPTED SOLUTIONS

Accepted Solutions
BitLord69
Memorable Member
Memorable Member

Where and how do you create a new user? If they do it themselves when they create the first form, you might be able to use CountIf or Lookup - if there is no record you know it's a new user and you can skip right to the form creation page:

 

If(CountIf(datasource, User = User().FullName) = 0, Navigate(FormcreationPage....))

 

If(IsEmpty(Lookup(datasource, User = User().FullName)), Navigate(....) )

 

Good luck!

 

View solution in original post

User is the column in your database that you referred to, and User().FullName is a built in function that retrieves the user name of the current user of the app.

 

In your case it's used to filter so the current user can see only his or her own entries.

View solution in original post

Why let them do the extra work and select user if you already know which user it is?

 

Using the function User().FullName you get the name of the user currently using the app, so you can remove the page/drop down with users altogether, making the interface smoother and less error prone (maybe it's not a huge problem if they select the wrong name, but still).

 

 

View solution in original post

5 REPLIES 5
BitLord69
Memorable Member
Memorable Member

Where and how do you create a new user? If they do it themselves when they create the first form, you might be able to use CountIf or Lookup - if there is no record you know it's a new user and you can skip right to the form creation page:

 

If(CountIf(datasource, User = User().FullName) = 0, Navigate(FormcreationPage....))

 

If(IsEmpty(Lookup(datasource, User = User().FullName)), Navigate(....) )

 

Good luck!

 

What does this do and how does it work?

" User = User().FullName "

 

User is the column in your database that you referred to, and User().FullName is a built in function that retrieves the user name of the current user of the app.

 

In your case it's used to filter so the current user can see only his or her own entries.

When the app is opened, the user is shown a page with existing users. If their name is not there, they can add themselves and then be directed back to the page with existing users. They can click on themselves to go to another page which shows all forms done by them. But if they are new, they would have no forms done, so it doesn't make sense to send them to that page, but rather to send them straight to a new form page.

Why let them do the extra work and select user if you already know which user it is?

 

Using the function User().FullName you get the name of the user currently using the app, so you can remove the page/drop down with users altogether, making the interface smoother and less error prone (maybe it's not a huge problem if they select the wrong name, but still).

 

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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