View Single Post
Old 09-30-2021, 07:03 PM   #735
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,200
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
This is explained in the Formulas Action documentation, of which the function from_search() is part.

To summarize; from_search() pulls data from multiple books, so it can potentially take up several minutes depending on the size of library and nature of the query. While in template dialog, you cannot allow this to happen, because the template gets re-evaluated with every letter typed, so it can completely freeze the dialog.

As a solution to the above, when in template dialog, from_search() always returns a fixed list of five items (e.g. '1,2,3,4,5') no matter the query being given to it.

Edit: Even though it returns a fixed list, it still verifies the arguments (field_name and search_string), and will return an error if it finds a problem with either.

Edit2: The items of the list and the separator are changed based on the field_name.

Last edited by capink; 09-30-2021 at 07:42 PM.
capink is offline   Reply With Quote