I have had the same experience, and where possibly like to avoid filter as you type on any Go solutions.
One way to optimize it would be to have the filter on an on-timer which runs every .3-.4 seconds. This is a really great way to optimize if the typing is slow on desktop, however I haven't tested on iOS yet. Since on timers work just great on iOS I imagine this might solve it.
you are filtering a portal by typing into a global, I presume ?
I use a global field for the search parameter but the items being filtered are not in a portal, just an ordinary list layout.
On reflection, there are quite a few operations which are significantly slower on a mobile device under iOS, so I guess what is required is a better algorithm or a native filemaker action to speed things up.
Can you upload a sample file that demonstrates the problem you are having?
Try the following:
Let's say your global is called gSearch.
in layout mode select all fields, disable quick find, then select the few you're searching on (must be indexed !) and enable quick find on them.
Attach this script to the OnModify trigger of your gSearch global:
Set Error Capture [ On ]
Allow User Abort [ Off ]
Perform Quick Find [ QuickFindPeople::gSearch ]
If [ Get(LastError) ]
Perform Find [ Restore ] // <--- inside here I search for "Youwontfindme" in an indexed field
Sort Records [ Restore ; No dialog ]
Go to Record/Request/Page [ First ]
Go to Field [ QuickFindPeople::gSearch ]
there are quite a few operations which are significantly slower on a mobile device under iOS
Yes - because the mobile devices tend to have less ram and processors speed. You have to take this into consideration when you are developing for the mobile.
I,ll try the approach set out by Siplus and let you know how it works.
I tried this approach which was similar to my orignal but it is no faster and the performance under FM Go is woeful. Thanks for your effort though, much appreciated.
I guess I'll have to wait a while for the hardware to speed up or better still, for Filemaker to include a native "Filter as you Type" facility.
By not positing a sample file demonstrating your problem or at least the script that you are using, makes it hard to fully trouble shot an issue. If your list has unstored calcs, conditional formatting or a very large number of records then FMGO might have trouble with speed especially if you are trying to filter on every keystroke. Instead of filtering on every keystroke you could find on Exit. I can filter a portal on every keystroke with FMGO across a LAN very quickly. The portal is sorted and there are 10000 records in the database. I use a single Set field script step that gets triggered on every keystroke. My ipad is an iPad Air 1.
If quickfind on an indexed field is slow for you, then I'm speechless. I have quickfinds on 1 million records in a client-server setup happening, scoring under a second all the time. Make sure you have only one field quinckfind-enabled on the layout and it's an indexed field.
I do have a preferred setup for "find as you type" but it's portal-related, not list-related.
I use a variant like the one cited by schamblee. A sample file is attached.
When a user types in the filtering global, one timer script fires, and if another keystroke is received in less than the interval set in the script, nothing happens. For instance, if a user quickly types three letters, Dan, then has a pause equal to the interval, the find fires and a portal is populated with records that match. If the user then adds more text to the global field, the process is updated.
On my iPad, I've found that the interval needs to be a bit longer, so the attached demo uses a 1-second interval. On a client, .5 seconds seems to be plenty. The attached demo doesn't test for device, but it easily could.
The technique could also be modified to use a quick find as siplus describes.
Dynamic Filter.fmp12.zip 1.5 MB
This works so well. Even on a client-server situation with thousands of records.
Thank you for sharing!
1 of 1 people found this helpful
Quite note, in FileMaker Go 16 this filter-as-you-type works flawlessly.