Is there a way to make the selected item from a "prompt with list" action editable? I am looking for a behavior where the user can ...
type in a few characters to filter the list of predefined options until only a manageable number of items are displayed
select one of the predefined item which should then transfer the selection to the search field
edit the text of the selected item in the search field before hitting enter
Steps 1) and 2) can be achieved with "Prompt with list" but I don't think 3) is possible.
In other words: I am looking for a field where the user can enter freely editable text strings but can first populate the editable field by choosing from a predefined list of text strings (with the option to filter this predefined list of strings for sake of convenience).
This would be a similar behavior compared to macOS Spotlight where you can start the search with a few characters, then select one of the items found by Spotlight (which copies it in the search area), and then still continue to edit the search string before hitting enter to finalize the search.
I am aware that this can be achieved in a two-step approach (the result of "prompt with list" is passed to a new user input window, where it can be edited by the user), but I was hoping to do it all in one step.
I'm pretty sure you could pull this off with a Custom HTML Prompt and related Javascript, but I'm not the right one to ask exactly how that Javascript would be written :).
I'm pretty sure you could pull this off with a Custom HTML Prompt and related Javascript
I was already expecting this kind of proposal. Unfortunately, I am still on the KM learning curve and my skills to create a custom HTML prompt (especially at the level required here) are almost inexistent. Hence I need to wait until I finally have the time to tackle this item on my todo list (learning to create custom HTML prompts).
An easy solution would be to follow the PWL with a User Input Prompt prepopulated with your selection.
Fully agreed, this is what I had in mind when I wrote about the "two-step approach" at the very end of my OP. I was hoping for a more elegant one-step solution but I gladly use this approach now that I know that the one-step solution is probably above my skill level. Thanks for sharing the macro.
Fully agreed. The only difference between your and my understanding is that I only counted the number of different windows as steps while you count it from a user perspective. Probably your approach is better from a user experience-perspective.
I'll just accept for the time being that this little extra convenience (all steps in one user interface) would require too much work (at least until I have grasped the basics of Custom HTML Prompts some time in the future). My (slightly naive) initial hope was that there would be some kind of setting to the Prompt with List action that would allow the user to edit the selected text before it being written into the output variable of PWL. This does not seem to be the case.
If you don’t mind, could you talk me through exactly how you envision the prompt working? Presumably, you would search for a string, then somehow enter editing mode so that text input is now active in the selection rather than the search field. Then you would edit the string and hit Enter to submit.
It's entering edit mode that I think might be problematic. It would require either clicking the line, which takes your fingers away from the keyboard to the mouse or trackpad, or a custom hotkey that you would have to remember. Either way, I think this is less elegant than hitting Enter, editing and then hitting Enter again.
"Prompt with List" allows you to select one or more items from a list.
What you want is a "combo box", which allows both item selection and free text entry -- and is the bane of all database admins! Depending on what edits you want to make you'll need to use either a "Custom HTML Prompt" with a combo box field, two KM prompts in series, or -- for combining a list choice and free text, eg a selected prefix and typed suffix -- a single multi-field "Prompt for User Input".
Honestly speaking, I did not think too long about how I would envision the functionality of the prompt in all details. After your question, I sat down to write down a proper description of the functionality (always a good idea to do this in the first place ... before asking others how to implement ). After doing so, I realize that my initial request might be much more complicated than what I initially anticipated.
Start typing a search string in the prompt with list input box until the selection of list entries presented is small enough. Note: in this mode ("editing mode"), the arrow left and arrow right keys can be used to move the cursor left/right in the input box to make corrections.
Once my input in the input box has narrowed down the list of selectable items sufficiently, I would use the arrow down key (multiple times, if necessary) until I have reached the list item closest to the string output I want to achieve. The usage of the arrow down key would change from an "editing mode" to a "string selection mode".
Press the left arrow key to choose the list item and copy it to the input box (this would also close the display of the list and would only show the input box)
Edit the copied string further until it matches exactly the output I wanted to achieve. In this "edit mode", no list would be displayed and the left and right arrow can be used again to position the cursor in the editing field.
Confirm my final edit with the enter key (which closes the entire process and passes the string back to the macro for further execution)
I am in no position to implement this quickly. So naturally, I am not sure if my theoretical process would work as intended when actually implemented. There are also lots of other alternatives (e.g., using the tab key to select from the list) which might make implementation easier. My proposal above is just one option.
macOS Spotlight works in a slightly similar manner (this is where I got the idea from) but the process described above seems to only work if you type in the beginning of the desired output because, in this specific case, the left arrow key simply works as an autocomplete function in the search field (and the search string remains editable in this case).
Thanks for pointing me in the right direction. As I wrote above, I unfortunately need to pause my attempt to implement this as I do not yet have the skill level required.
Thank you so much! I will definitely look at it. Unfortunately, it might take until the weekend until I have time to test your macro and provide feedback to you.