Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GetNthRecord ... perhaps?

Featured Replies

I have a list of records in a "child" database, for which some data is repeated. Think a list of students where each student may have multiple records, one for each of her classes.

I need a field which says basically "which portal row the record would appear on in the 'parent' record." If David has seven classes, I want his first record to say 1; the second, 2; etc.

I don't want a summary field. GetSummary() is not of much use in my opinion. Is there a way to hard code this field?

I have seen others do cool things with GetNthRecord, and I have adapted it to my own use (i.e. replacing GetValueListItems). I feel the answer is close.

I would value and appreciate and feedback you could offer.

DSW

Hi,

Sorry but can you explain using another example to what exactly you are looking for.

Take a look at the following Custom Function:

PositionValue ( text; searchValue; start; occurrence )

At: http://www.briandunning.com/filemaker-custom-functions/list.php

If you already know how to use GetNthRecord to get the list, just pass it to this CF.

[Yikes, Brian's list is temporarily down. Here's the text of the CF, which I've saved:

PositionValue ( text; searchValue; start; occurrence )

Geoff Wells, DataIsland Software LLC

http://onestopfilemaker.com

Same as the Position function but for Values

Sample Input:

PositionValue ( MyList; "Seven"; 1; 1 )

MyList contains

One hundred

Two hundred

Thirty

Four thousand

Five hundred

Six hundred

Seven

Eighty eight

Sample Output:

7

---------- code ------------

Let ( adjustedText = "�" & text & "�" ;

If (

Position ( adjustedText ; "�" & searchValue & "�" ; start ; occurrence ) = 0 ; 0 ;

ValueCount ( Left ( text ; (Position ( adjustedText ; "�" & searchValue & "�" ; start ; occurrence ) - 1) + Length ( searchValue ) ) )

)

)

------------------

Description:

In the same way that the Position function provides the number of a character position in a text string, PositionValue calculates the value number of a text string in a return delimited list.

Edited by Guest

  • Author

Fenton,

Wow did that hit the spot! Just perfect.

By applying the PositionValue() CF to the result of the AppendNth (a.k.a. GetNthRecord()) CF applied to a self-referencing relationship, I get the local value for the nth related record.

Now I can find a single record for each among a group "child" records. Also, finally, no ValueListItems().

Big help! Many Thanks.

DSW

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.