Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


Privacy Policy

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.


 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

PortalFirstVisibleRow ( _portal )

Rate this function:  

  Average rating: 4.3  (33 votes)
  Discuss this Custom Function

Arnold Kegebein,

Get index of first visible row in a portal (FM12+ ONLY)

Sample Input:
PortalFirstVisibleRow ( "myPortal" )
Sample Output:

 Then copy & paste into FileMaker Advanced's Edit Custom Function window.


THIS CF IS FOR FM12 ONLY! For a FM11 version of this function check out

Calculates the index of the first visible row in a portal.
The parameter _portal is the object name of the portal.
Besides the object name for the portal, at least one object in the portal has to have an object name, too.

Instructions how to use this function:
(1) Create a portal.
(2) Give the portal an object name, e. g. "myPortal"
(3) Place an object into the portal, preferably a field from the portal table.
(4) Give this object an object name, e. g. "myField"
(5) Change to browse mode.
(6) Call the function (via data viewer or script or button): PortalFirstVisibleRow( "myPortal" )
(7) Scroll to a different row in the portal and call the function again.
(A) If the function returns 1, the very first portal row is visible. The return value 5 means, the portal is scrolled so far down, that the first four portal rows are not or less than 50% of the row height visible.
(B) To verify the correct return value, add a label with the text "@@" to the portal. This will print the actual index of each portal row. The first index you can see in your portal should be the same value the function returns.

Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it


5 most recent comments | Show all 7 comments

Not working here. I think there is a problem with the syntax. Using FM12

silba, Chicago
January 28, 2013 2:12pm

I cant get it to work either. I have named the portal and a field in the portal but just get ? as the result. Are you able to post an exmple file like you did with the fm11 version? (that works)

Chris, Melborne
May 08, 2013 6:51pm

This function is recursion bombing. Arnold, I was very hopeful when I stumbled across this but it's not working as noted by the previous 2 posts. Now on FM14. Did FM change behavior again? I could not get the pre FM 12 version to work either.

Rob, Cleveland, OH
September 25, 2015 6:11am

That was just what I needed. Great job! Thank you!

moxa4, Berne, Switzerland
September 27, 2016 3:51pm

I am trying to use this on FM 17.
When I load the fm dbase it works beautifully. Shows the the first portal row number in the data viewer as it should. When I scroll down and hit refresh sure enough it has the right number.

If I go into layout mode and then return to browse mode all it displays it a '?'.

The only way to get it to reset and work again is to completely close filemaker and reload it and the dbase. Once again all is well until I go into layout mode....

Nice custom function but has a flaw that is a bit irritating to deal with.

Darrel, Portland
June 11, 2018 9:28pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 8 + 4 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. ChiSquare3x2 ( param ; param ; param ; param )
  (Tue, Aug 14, 6:33am)
2. ReverseByteOrder ( bytes )
  (Thu, Aug 09, 12:06pm)
3. BytesToDec ( hex )
  (Thu, Aug 09, 11:47am)
4. GetAsHexBytes ( number ; bytes )
  (Thu, Aug 09, 10:50am)
5. ValCorrelationCoeff ( XValueList; YValueList; Xmean; Ymean; XStdDev; YStdDev )
  (Wed, Aug 08, 4:17pm)
6. ValLeastSquaresSlope ( XValueList; YValueList; Xmean; Ymean )
  (Wed, Aug 08, 4:10pm)
7. ValueMath ( List1 ; List2 ; operation )
  (Wed, Aug 08, 4:05pm)
8. GetExtension ( File )
  (Tue, Aug 07, 10:22am)

RSS Feed of Custom Functions