Let Users Know How Many Records are in a Gallery's full recordset

8 months ago
4

PowerApps galleries load records in chunks of 100, so a user is left wondering, "Is that everything?"

When Delegation Limits also come into play, the problem can be even more difficult. If the gallery contains exactly 500, or 2,000 records, is that all there are, or is that a result of delegation?

I solved the dilemma with a PowerApps flow and a Stored Procedure in SQL Server.

Here's the SQL from the Stored Proc. The rest of the code is revealed in the video.

USE [NameOfYourDatabaseGoesHere]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE OR ALTER PROCEDURE [dbo].[RecordCount]
@SearchTerm varchar(10) = ''
AS
BEGIN
DECLARE @Recordcount int
SELECT @Recordcount = count(*) FROM dbo.Employees
WHERE LastName like '%' + @SearchTerm + '%'
OR FirstName like '%' + @SearchTerm + '%'
RETURN @Recordcount
END
GO

Links to downloads:
https://www.gpcdata.com/downloads/Employees2K7.zip
https://www.gpcdata.com/downloads/Employeesbacpac.zip

Loading comments...