02-22-2023 01:50 PM
Like the title says, I am looking for an example of querying for documents where a specific keyword is empty or blank (empty string).
What I’m seeing is that the API is returning all documents, not just the ones with blank values for the keyword.
How can I specify that I really want to find the documents with blank keyword values in a GetDocument request?
It seems like a simple thing, but so far I haven't been able to find any guidance in the SDK programmers guide or the Sample Browser, but I may just not know what to look for.
02-22-2023 02:10 PM
Paul,
OnBase doesn't store keywords without a value, except in the case of a keyword group. Single-instance and multi-instance keyword groups can store null values. For regular keywords, there isn't an API nor user interface that allows for the retrieval of documents that have a missing (blank) keyword value. To do this, I've always used a SQL query where the document and keyword tables are outer joined, and I look for all docids in the document table that have don't have a corresponding one in the keyword table.
This query can also be placed in a custom query configured for custom SQL. I believe you could run that query via API, though I've never done so.
02-23-2023 05:34 AM
It is not so simple but... There is a trick that can be used and that is to use the DocumentQuery DisplayColumn. Adding DisplayColumns allows you to added a keyword to the query as a column in the same way you would use a CustomQuery. The results that are returned will have a NULL value if there is no value assigned to the keyword.
The downside is that when the results are returned you will need to iterate through the DocumentList and find those NULL values as there is no way to filter them out without iterating.
This does require the use of the ExecuteQueryResults() to return the DocumentList and the DisplayColumns.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.