MA Search Picker

by jaredhague

This is a simple module that can bring search to a large value list.  This demo has a value list of 10,000 records ( the content of demo was randomly generated )

Main Features

  • Sorts your list for you.
  • Search as you type
  • Long text items wrap
  • Run scripts by calculated name
  • Style with CSS
  • No extra TO required
  • Add to a slider for drill down.

updated to v1.1

There was a problem with the search box not drawing on a mac sometimes.  This was due to the animation of the popover.  I was able to get around this problem by starting the elements position property as relative on initial load and then flipping it to fixed with js after a short delay.

SearchPicker 1.1.fmp12

15 responses to “MA Search Picker”

  1. john renfrew says:

    jared, this does not always seem to work if the list is much smaller, say 200 items
    the list shows but not the search box at the top of the web viewer

    • Ricky Chan says:

      Hi Jared,
      Thanks for this awesome module, using web viewer associated with script is getting its popularity when developing solution.

      Hi John,
      I am experiencing the same for both large and small item list. I had added another button, with a script going to the named popover object containing the web viewer. This seems to solve disappearance of the search box. the search box appear every time I click on the newly added button. Would this solve the problem for you? Would be grateful if you let me know, thanks.

      • jaredhague says:

        I have solved this issue in version 1.1. It was because how filemaker loads the web viewer when opening in a popover. For some reason it would not draw elements with a fixed position. I assume its because the popover is moving when the web viewer is initialized and the windows value changes. Before I was solving this by removing the animation of the popover by using go to object script step or not using a popover.
        The way I got around this is by having the search box position relative. Not ideal because it would scroll up with the content. So I added some js to change the property to fixed after a short delay.

  2. Milan says:

    Great script,
    i am just wondering how to use the selected value further to go to the related record or place it in a script.
    Would appreciate greatly if you could explain this a bit further.

    • jaredhague says:

      When you choose a value a script runs that has the ID as the parameter. So you can do whatever you want with it from there. The custom functions last parameter is the script name of the script you want it to run. So just use Get ( ScriptParameter ) to grab that and use it appropriately. You could also just use the run script option in the provided script.

  3. Nicholas De Leo says:

    Hi,
    since I upgraded to FMP 13 v5 it doesn’t work anymore. I get this error message:
    ‘The file “SearchPicker 1.1” could not be opened. Either the host is not available, or the file is not available on that host.’

    Best,
    Nicholas

  4. Michael Twisdale says:

    Hi Milan,

    open the custom function, MASearchPicker. At the beginning of the Let statement, You’ll find the definition ~linkStart. It needs a small adjustment. It should should be redefined as
    ~linkStart = Case (
    Get ( ConnectionState ) = 0 ;
    “fmp://$/” & Get ( FileName ) & “.fmp12”; // ***** CONCATENATE “.fmp12” *****
    Substitute ( Get ( FilePath ) ; “fmnet:/” ; “fmp://” )
    )
    &
    “?script=” & pickScriptName & “&param=”;

    That is, the extension “.fmp12” has to be added to Get ( FileName ) in this case. That’s it.

    all the best,
    Michael

  5. Michael Twisdale says:

    Hi Nicholas,

    open the custom function, MASearchPicker. At the beginning of the Let statement, You’ll find the definition ~linkStart. It needs a small adjustment. It should should be redefined as
    ~linkStart = Case (
    Get ( ConnectionState ) = 0 ;
    “fmp://$/” & Get ( FileName ) & “.fmp12”; // ***** CONCATENATE “.fmp12” *****
    Substitute ( Get ( FilePath ) ; “fmnet:/” ; “fmp://” )
    )
    &
    “?script=” & pickScriptName & “&param=”;

    That is, the extension “.fmp12” has to be added to Get ( FileName ) in this case. That’s it.

    all the best,
    Michael

  6. Jared

    Nice idea for a module. I think the documentation needs to be improved in order to ease the process of integration.

    For example, I see that there are scripts and possibly schema that needs to be created, but the docs only call for copying of custom functions.

    Perhaps I am misunderstanding, but I think there needs to be more instructions on how to use this in an existing solution.

  7. Santosh Singh says:

    Hello frienda
    Is this modular script can be use to search in dropdown list field within the portal table . If so how it can be pls support for this.
    ThaNKS

  8. Santosh Singh Solanki says:

    Hello jaredhague,

    It is great modular script to find or search within portal table. As per demo I have applied custom functions as well as script to my solution . But when I hit the popover button it display the popover but the list name is showing undefined. .Pls give me the feedback.

  9. Mauricio says:

    Hello,
    How can I use it at Filemaker ProRuntime Solution?
    When I pick someone I get this error message:
    ‘The file “my file” could not be opened. Either the host is not available, or the file is not available on that host.’

    I already change the definition ~linkStart

    thanks in advance and great job

    • Mauricio says:

      hello again

      I uninstall filemaker pro in order use just Runtime solution and when I use ma search picker I get a message say “Some files or content of this website require a program that is not installed.”

  10. Jan says:

    Hello,

    At first i have to say that this tool is great, but i don´t know how it works in search modus. Can someone help me please ?

    Thanks,
    Jan

  11. Evan Z says:

    No instructions for how to apply. Am trying but cannot get to work. Twisdale, added your fix to make it actually select in the example file. Cannot get it to work with my project at present though.

Leave a Reply

Your email address will not be published. Required fields are marked *