Jump to content

Workflow script filter with one-shot completion


Recommended Posts



Currently, script filters are stateless -- if one takes an argument, the filter script gets called after each letter is typed in order to regenerate the suggestions list.


I've got a few cases where the full list of possible suggestions is known regardless of input, but the list is large and I'd like to allow the user to narrow down the options by typing more letters.


For example, I have a script filter 'foo' that returns options ['bar', 'baz', 'quux'].  As soon as the user types 'foo b', that should be reduced to ['bar', 'baz'], etc.


Of the two ideas I have involving this at the moment, the first has all of its data generated locally.  Therefore, I could update the generation script to take another parameter to filter results by without too much pain.  However, the second workflow gets its data from a JSON webservice.  The webservice isn't really designed for autosuggest, and is way too slow to consider calling it after every character.  Because of the stateless nature of filters, if I wanted to make this workflow useful I'd have to deal with caching request data somewhere, expiring the cache, filtering results, etc etc.  Do-able, but painful.


Would there be any value in a new type of script filter that accepts a single long list of items, each of which is valid, and then deals with allowing the user to narrow down the selection by additional typing without needing to call out to the original script again?

Link to post
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...