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.

GetNth portal row record ?? comparing one portal row to the next ..

Featured Replies

Hi there,

I have a portal of time events that are sorted earliest first by the portal. The records were created at different times so the record numbers and ids are not in succession.

I'd like to create a relationship that is valid if there is more than a certain amount of time between two records.

The reason behind this is that the portal is being used to create someone's daily agenda, and we can't have too much time between meetings. I don't want to script it, I want it to be a text field that shows "There is too much free time between these meetings" if the relationship is valid.

Is there a way I can compare the end time of one portal row with the start time of the next portal row ?

I tried to use the Get(PortalRowNumber) function but it delivers question marks when I place the field in the portal. I was hoping to create a relationship from that field to a "Portal Number plus one" field. But I guess that doesn't make sense.

thanks,

Any advice would be appreciated :)

The problem is that Portal Row only has meaning within the portal, so while it's useful in script running through a particular portal, that's about it. GetNthRecord, on the other hand, can be used on related records, which the "portal" records are; from the parent TO.

However, the calculation using GetNthRecord would need to be evaluated within the child table, because that's where the multiple records of child data are.

So, from what I can see, you would need to create a self-relationship within the child data to "mirror" the relationship from the parent to the child. This may or may not be difficult; but should be possible. The self-relationship would need to be sorted the same as the portal (or relationship). [i didn't do that.]

Then you can use that self-relationship with GetNthRecord ( self-relationship::data; Get ( RecordNumber ) - 1 ). This field can then be used in calculations and/or show in the portal.

Caveat: there may be an easier and more direct way to do this, but I can't think of it.

(P.S. I could not for the life of me get the "?" not to show up in the 1st row; it's Time.)

PrevRelatedGetNth.fp7.zip

Edited by Guest
Sort

  • Author

Cool! I see how this works. Thanks Fenton.

Your display picture is quite disturbing... I thought the children were our future?

Provided they are educated about our past: Link

  • Author

does it really disturb you or was your jest lost in the translation? (frankly, i mainly thought it was a neat animated pic and liked the thought of being victorious with what are considered by many to be a weak tool) ahem.. :

I was with you right up until you said

weak tool
:

Lee

You can get rid of the ? in the first line by defining cTimeDiff =

If ( Get (RecordNumber ) > 1 ; Time_ - GetNthRecord ( AnimalName_self_Animal::Time_; Get (RecordNumber ) - 1 ) ; GetAsTime ("") )

  • Author

don't get me wrong Lee, I think FileMaker is an incredibly powerful tool. Some aren't as enlightened however.

  • Author

weird... I guess I really love FileMaker because I became really concerned to learn that you felt I referred to it in a mediocre light

Sometimes we only become aware of how strongly we feel about something (or someone) when they are put down and our defensive mechanism kicks in. I've always liked your avatar and view it as 'true strength is determined by grit and not by size.' It provides hope and (internal) strength to many. :smile2:

Ooops, I wasted bandwidth ... :shocked:

Love the sarcasm tonight Laretta. :giggle:

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.