cancel
Showing results for 
Search instead for 
Did you mean: 

Autofill keywords from an external database SQL query

Kevin_Cook2
Champ in-the-making
Champ in-the-making

While I am indexing my document, I would like to enter a value in one keyword field and then do a lookup based on that keyword value to an external database using SQL and then autofill other keywords for that document using the results from that query.  How do I set that up?  Thank you.

3 REPLIES 3

Bryan_Hurless
Star Contributor
Star Contributor

Hello Kevin and thank you for using the OnBase Community!

 

It sounds like using an External Data Set for your Primary Keyword in an AutoFill would work for you. Using an External Data Set you can pull data from any database using a SQL Select String, VB Script, Unity Script or EIS Datasource. You can even pull values from an existing OnBase Keyword type which you can see in my example below.

 

You will want to create a new Keyword Type and enable the "Use Keyword Data Set" option.



In my example I am using an existing Keyword Type in OnBase that already has values, but you can use any table in any external database with a query that will look similar to what is seen below. In my example I am pulling values from the "Cascading DS > AutoFill - Primary (Source KW)" Keyword Type (#2017).



Select the new Keyword that is going to be running the external Query and click the "Data Set" button then select the "External" checkbox then click the "External" button.



Here is what your external Data Set Query will look like (For more information on External Data Sets check the System Administration Module Reference Guide around page 446).



Now create your AutoFill and make sure that the newly created Keyword with External Data set is the Primary Keyword.



When you login to the Client you can expand the Data Set to see all results or enter a partial value to filter out the results.




If you select a Primary that has a matching AutoFill record the record will expand automatically.




I hope that helps answer your question, thanks again for using the OnBase Community!

Hi Brian,

I tried something similar but I can't get it to work.  I have an AFKS (hsi.keysetdata187) that populates 3 keywords:  Item Number (ks549), Item Description (ks550), Item Cost (ks552)

 

I want to use the data from that AFKS (hsi.keysetdata187) to populate a new AFKS (hsi.keysetdata192) for 3 new keywords:  "SO Item Number" (ks557), "SO Item Description" (ks558), and "SO Item Cost" (ks567).

 

I created an external data set on "SO Item Number" (ks557) with the following SQL query:

SELECT keyvaluechar
FROM hsi.keyitem549
WHERE keyvaluechar LIKE '%_filter_%'
ORDER BY 1

 

When I enter a Search String that exists, it says "No rows found for this primary". 

 

I am not sure what I am doing wrong.  I basically just want to use the values from the first AFKS to populate the values in a second AFKS.

 

 

Hey Evelyn,

 

Can you try changing "_filter_" to "@primary"? The "_filter_" parameter is for External Keyword Data Sets, while "@primary" is used for External AFKS.

 

Thanks,

Brian