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.

Using portal rows in a calculation field

Featured Replies

  • Newbies

I guess my question is related to the precedent message, but here I go:

Is it possible to make (via a calculation field) a list of related portal rows for a

given record ?

I tried :

"First item : " & RelationName::Field.0 & "Second item : " & RelationName::Field.1, etc

but it is not accepted by FMP 6...

Yes, but it will require creating a valuelist for each related field or a valuelist based on a related calculated that concatenates the desired fields, a global repeating number field with as many repetitions as possible related records, an auto-entered or calculated value of 1, a self-relationship from this '1' field to itself, a repeating indexed number field that looks up the global repeating field using this relationship, a trigger field based on modification time, a calculation that returns the current serial when a record is modified, a relationship from this calculation to the serial field, an indexed repeating calculation field that parses the valuelist(s) to pull the data for each line, a valuelist based on this field, and an unstored calculation of the ValueListItems( ) for that valuelist. You'll also need a script to set the serial field to itself to force a refresh.

Trust me, it's much easier to go to the related records and run a script that loops through them and sets a related field (back to the parent file) with the current data. wink.gif

  • Author
  • Newbies

I had a good laugh reading your answer thank you smile.gif

That's sometimes the way things look in FM....but the solution

is always simpler than what you thought !!!

The answer you gave to Kip sounds good too so i'll tell you when

it works for me

goodbye

dom

It might not be as complex as Q made it sound. A simple script step:

Set Field [ result, ValueListItems( Status (CurrentFileName), "yourRelatedRecords" ) ]

...would give you

related field 1

related field 2

etc.

You would need to create the "yourRelatedRecords" value list, that's easy enough.

The tricky part is pre-pending each item with "First," "Second," etc.

Yes, but that's going beyond the original question of how to do it using just a calculations. wink.gif Setting the ordinal values using VLI could be quite a bit more complicated than looping through the related file, I would think.

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.