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.

Faster method to get the last related record?

Featured Replies

I have two tables:
- todo
- response

I have a list view layout: todo_list

On the layout there is a single text area with the following merge tags:

<todo::dueDate> <todo::detail> <todo::lastResponse>

 

the field:  lastResponse, is a calc field in the todo table

If ( Count ( response::id ) > 0 ; 

   GetValue ( response::user    ; 1 ) & "| "&
   GetValue ( response::comment ; 1 ) 
 
"" )

 

The relationship to the response table, is sorted by ID descending. That way I get the most recent response to the top of the list for the calc above.

 

While the performance is okay, I am wondering if there is something I could do to make the list display faster/smoother since it is a bit choppy.

 

 

 

 

speedPlease.mp4

Edited by rivet

Since the relationship is sorted, you could just display the two related fields directly, without using a calculation. You could then use the "Hide object when" feature with a calc of IsEmpty(response:id).

Note that hiding the object is only necessary here to hide the vertical pipe. You could try it without that and see if it helps performance. I would expect that using IsEmpty() should give you slightly better performance than Count().

You could also try using a non-sorted relationship, and getting the related fields using the Last function, keeping in mind that if one of the fields can be blank, you might get mis-aligned results. To get around that, you could calculate the concatenation in the response table, and then get the Last of the calculated field.

  • Author

Thanks Fitch, that got me in the right direction.   In the end I just merged the fields from the related table directly onto the parent layout.  The merge takes the first record from my sorted relationship and I am just going to live with the empty pipes.

Or you could apply a Hide to the field if it's only pipes...

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.