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.

Filtering a portal using criteria from 2 tables

Featured Replies

Hi,

I've been hitting the wall with this problem for a couple days. I keep getting close, but can't seem to solve it.

I have a table for film festivals (FESTIVALS) joined to a table for deadlines (DEADLINES) by a festival ID Key.

My goal is to set up separate portals showing me what festivals have deadlines today, in the next week, and in the next month, with info from both DEADLINES and FESTIVALS tables in the portals. So far no problem. I added globals to the deadlines with dates, then made TOs and joined them to the Deadlines table. So there's DeadlinesLastWk, DeadlinesToday, etc. These TOs are joined to Festivals TOs. The parent Deadlines TO is joined by a cartesian to a new UTILITY table. The portals are on layouts connected to UTILITY so I'm not in danger of accidentally deleting Festival or Deadline records. So like:

Utility - Deadlines - DeadlinesLastWk - FestivalsForLastWk

My problem came in when I tried to add one more filtering feature. Festivals can be marked "Yes" or "No" under the field "ForUs" in the FESTIVALS table to indicate whether or not they are relevant. I want the portals to only show festivals within given deadline dates and where ForUs = "Yes".

I tried solving this using a global field in the Deadlines table with the value of yes (g.Yes) and adding that criteria to the link with Festivals. If I do this and set the portal to the Deadlines TO, everything looks good if ForUs="Yes", but the ForUs = "No" deadlines show too with just blank spaces for the Festival's info. Or, if I set the portal to the Festivals TO, I get only the ForUs="Yes" festivals (like I want), but the deadlines that display are all for the first festival listed, rather than for each.

I can't think of another way to put together these relationships to make it work. I would really appreciate any advice you can offer.

Thanks,

Lev

Festivals can be marked "Yes" or "No" under the field "ForUs" in the FESTIVALS table to indicate whether or not they are relevant.

Is this a permanent setting, or can it change? If it changes, should the change affect already entered deadlines?

  • Author

The ForUs setting would change very rarely, but if it did, Yes I'd need it to change on the already entered related deadlines.

L

Edited by Guest

Well, the simple approach would be to (a) lookup the ForUs value into the Deadlines record, and (??? follow any change of the parent value with a relookup in the related child records.

Otherwise you would need to use the so-called "Ugo method" (you can find several examples of this in the forum).

Or upgrade to version 11 and use a portal filter.

  • Author

Thanks for the advice. One thing I never got about Lookups (which is why I avoid them) - they only update the child field when the join field is updated, right?

So in this case, if I make a lookup field in Deadlines for Festivals::ForUs, the lookup would only update if I add/delete/change the ID key of Festivals, but not if I just change Festivals::ForUs.

Can this be fixed with relationships? Or do I need to use a script trigger to update the lookup in Deadlines?

the lookup would only update if I add/delete/change the ID key of Festivals, but not if I just change Festivals::ForUs.

Yes - that's why I said you would need to perform a relookup in Deadlines after modifying the ForUs field in Festivals. Since you said you'd change it very rarely, this might be acceptable (you could also attach a script trigger to the field, so that the relookup is performed automatically).

To do this with relationships, assuming the following fields in Deadlines:

• DeadlineID (auto-entered serial number)

• FestivalID

• Date

add a calculation field cTodayID =

Case ( Date = Get ( CurrentDate ) and Festivals::ForUs = "Yes" ; DeadlineID )

then add a self-join of the Deadlines table:

Deadlines::cTodayID = Deadlines 2::DeadlineID

A portal to Deadlines 2 (through Deadlines) will show only today's deadlines of the relevant festivals.

  • Author

That worked - Thank you!!

Lev

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.