0

I am working in Filemaker 12, I would like to have a special type of dynamic value-list (which would certainly be possible if I could relate tables via a "contains" operator).

I have a persons table with around 500 entries, which has fields for name and personid. In order for a user to input a personid (into a related table), I want them to use a value-list.

Using a value-list of the entire list of personnames is not very practical (it entails a lot of scrolling or knowing the precise name). My idea was to include a namesearch (a "dummy" global variable which I can use to narrow down the list), so the user would type some part of the persons name, and the value-list would update to include only those persons whose name contains namesearch.

Note: Contains can be achieved using the filemaker function PatternCount.

I know how to create a dynamic value-list based on the relations in a table (using "include only related values starting from: "), but unfortunately "contains" does not appear as possible operator in the Manage Database < Relationships... Is it possible to add a relationship with the operator contains?

If this is not possible, is there another way to produce this value-list behaviour?

Community
  • 1
  • 1
Andy Hayden
  • 359,921
  • 101
  • 625
  • 535

1 Answers1

1

What you describe is similar to the default behavior of the value list. I.e. initially it lists all names, but if you close the list, type a part of the name, and open it again, it will show only the people whose names start with what you typed. To open or close the list you can use the ESC key; it's not as smooth as, say, in good AJAX typeahead widgets, but works.

Another way to accomplish this is to have a portal to the people table and set up a filter based in your global field. Here the portal will work as a value list that is always open.

Yet another way would to use a trigger to search the people table, grab all IDs from the found set and place them into a global variable. This can be done with a script, but the faster way is to write a custom function that uses GetNthRecord to loop over records in a found set. Now you can establish a relationship from this variable to another instance of the People table and have a filtered value list.

Mikhail Edoshin
  • 2,639
  • 16
  • 25
  • Is it really the case that this is the default behaviour (closing, typing, opening again, filters), I'm sure I have seen it happen once or twice but it certainly doesn't occur most of the time for me... – Andy Hayden Jun 22 '12 at 13:43