cancel
Showing results for 
Search instead for 
Did you mean: 
Daniel_Quill
Elite Collaborator
Elite Collaborator

Keyword Dataset values have been a part of OnBase for quite some time.  It is a quick and convenient way for accessing the pre-defined list of values that are used to populate a dropdown list.  However, what about the keyword dropdown values that are not pre-defined as a Dataset?  Well, with the release of version 15 it is now possible to configure a dropdown list enabled keyword type and retrieve the values via the Unity API.

Implementation

Retrieving the list of keyword type values that are not set as a keyword type dataset is now available via the Unity API.

A new method has been added to the KeywordType object.  The method GetDropDownValues() will allow a developer to access the values of a keyword type that is not strictly setup to be part of a Dataset.

  1. Retrieve the KeywordType object

    KeywordType keywordType = _app.Core.KeywordTypes.Find(KEYWORDTYPE_ID_OR_NAME);
  2. Populate a DataSet object with KeywordType values

    1. Note that a string or partial string can be passed the method.  This string will be used as a filter for the values returned.  For instance, return all value with the first three letter of “ONB”.  This will filter the returns to only those value that begin with “ONB”.
    KeywordDataSet dataset = keywordType.GetDropDownValues(string.Empty);
  3. The returned result will be in the form a list can be iterated through. For this example I’ll just write the contents of this list to the Console.

    foreach (KeywordDataSetItem item in dataset){   Console.Write(item.Value.ToString() + Environment.NewLine);}

Considerations

When leveraging GetDropDownValues(), the string value provided is not meant for fine grain searches, but rather a partial value working forward from the input. This means that characters denoting wild cards or concatenated searches don’t work and will only restrict search to explicitly what’s put in.

Although this function returns a valid KeywordDataSet object, it must be understood that these values are not associated with any configured Keyword DataSet or Autofill KeywordSet.  These values are derived from accumulation of values indexed to the Keyword Type.  The dropdown values themselves are added to the list everytime a document, which is associated with the keyword type, is successfully indexed with a valid value. 

It is also worth mentioning that this list is stored in the database and cannot be directly modified or configured.

In Summary

The ability to acquire the KeywordType dropdown values will provide additional flexibilty when populating the dropdown list of a custom application.  This may also be used for validation purposes if you need to restrict access based on the keywords that have been used to index a document.

For any questions or concerns be sure to leave some comments in the area below.