The command palette is a query constructor which translates user intent into a query which finds the applicable command.  Commands are found by a combination of Actions, Objects and Fields.  The system uses permission-aware filtering to only display commands that the connected user has access to.  

Most data fields are user-configurable and hence are not natively known to the application – they must be read from the database.  At session start, endpoint calls are made to collate a list of all available user-configured field names.  The file metadata-field-loading.csv contains three columns.  ReadRoute maps to the ReadRoute column in read-routes.csv.  This points to an endpoint that will retrieve a table of field names.  The field name ID and field name columns are identified by the labels in the FieldKeys column of metadata-field-loading.csv, separated by '::'.  The application calls each endpoint and creates a table which maps each field ID and name to the field type in a FieldNames table comprising FieldID, FieldName and FieldType.  This is used to map field names to the Fields column of command-palette.csv.  However there are additional field names which are fixed and are not retrieved by endpoint calls.  These are added to the list as follows.  The Fields column of command-palette.csv contains field names separated by ';'.  This column is read and any string within the Fields column that doesn't match a FieldType entry in metadata-field-loading.csv is added to FieldName and FieldType, with FieldID left blank. 
 
Also at session start the application parses command-palette.csv as follows.  It constructs a list of unique action words from the Actions column of command-palette.csv and does the same for the Objects column.  Hence three tables are stored in session state memory: FieldNames, Actions and Objects. 
 
The command palette UI has three fields: Actions, Objects, Fields.  The user can type multiple entries into each field, separated by commas.  
As the user types into the action field the application searches the table of Actions to find a match (using fuzzy matching).  Each Actions word match is used to find entries in the commant-palette.csv table which have that Action word in the Actions column.  The same is applied to Objects.  

As words are typed into the Fields field the application searches the FieldNames table for a match (using fuzzy matching).  Each match is used to retrieve the FieldType which corresponds to the FieldName and then identify commands in command-palette.csv which have the FieldType in the Fields column. 
 
Results are ranked according to the following algorithm.  All commands which have at least one match are given a score according to the number of matches for that command.  The results with the top score are displayed.  Within the results the Weight field in command-palette.csv is used to rank the results, from highest weight to lowest.     

The command palette has other buttons: Name/Description Search, All, Recent and Favorites.  The Name/Description Search searchs the command name and description fields.  The All button displays all commands which match the selected user roles stored in state memory.  The Recent button displays commands which have been used in the current browser session.  The Favorites button displays a list of favorite commands.  Favorites are stored via an Add To Favorites context button and are stored in browser local storage.  
When a command is selected, if the ActionType is FORM then the FieldId and FieldName values are passed on to the form and the corresponding field pre-populated when the form is displayed.  
