Siebel CRM as a custom Search source

This post is inspired by a conversation I’ve been having over the last few days with another OPA consultant (thanks Prashil!) . Although as it turned out, the requirement had nothing to do with Siebel (that will teach me to not assume anything!), the concept of making REST calls to a CRM or CRM-like data source has been on my mind. But how can I use Siebel CRM as a custom Search source?

In this example, we will use Siebel 2018 as the source of a custom Search box. Along the way we will see how the Siebel CRM REST API sends us data and what we can do with it. At the same time, we will indulge in some trickery to not show everything we have in our Search results to the user. It will mean we create two JavaScript extensions, a Search and a Full Input.

Firstly, the Siebel 2018 instance in question is using the standard REST API, and it is the standard Component called Account which we will be querying. In many public services, Account is used to store partner organizations, external suppliers and so on. It is a very common component. The base URL for the REST calls in my case will be something like the following

https://XXXX:9001/siebel/v1.0/data/Account/Account/?fields=Name,Location&?ChildLinks=None&searchspec=([Name] LIKE '"

There are three things to note here.

Firstly I am only interested in two fields (the third field I need, Id, is actually going to be included automatically anyway).

Secondly I am using a Search Specification with Siebel standard syntax to search using the Name of the Account. So if I type “ABC”, it will look for Accounts starting with ABC.

And finally, the URL string needs to be capped with the following to finish it “*’)” so that there is a wildcard search for ABC Inc, ABC Corp. and so on. The URL also includes an argument regarding child links in the output to reduce volume.

Siebel CRM as a custom Search source

The information returned in a standard output will consist of a series of data.items. So we can iterate over the data.items and for each item, we can get the Item.Name, Item.Location and Item.Id. Since Siebel paginates its output, we are actually only going to get a maximum of ten records unless we add another URL argument and make further calls to Siebel (to get page 2, page 3 and so on). But for a query result, a ceiling of 10 is pretty good for Siebel CRM as a custom Search source.

As a side note, this example – you have noticed – is using the Siebel REST API in its unvarnished, naked form. Obviously you would do well to control / restrict access and authenticate consumers in real life. We’ve seen in previous examples that we can pass headers in our Ajax call when Oracle Policy Automation asks for data from a Search source.

In the Commit callback we will update three attributes with the values of the Siebel Fields I just mentioned. Now, at the moment, if you want to update an Oracle Policy Automation Attribute in a JavaScript extension, that attribute needs to be on the active Screen for it to work. So what happens if you don’t want to show that value to the end user, but you still want to capture it for future use in your rules?

One approach (which I am using for demonstration purposes only you understand, as usual) will be to create an invisible Input, so that we can add our data to the Screen without the user seeing it. To do this you might use a fullCustomInput extension. This is different from the customInput, because it manages the Question Text and the Input control. So we can place it on our page and format the whole thing – even perhaps make it disappear.

Siebel CRM as a custom Search source

The two examples working together are shown in the video below. I am also in the process of adding them to the Template Generator, so you will be able to generate a fullCustomInput and a sample customSearch yourself as well.


Have fun with Siebel CRM as a custom Search source, and as always the official documentation is your guide.

September 2021 : An updated example of this including HTTPS support appears in the latest version of our Consultants Guide to JavaScript Extensions for Oracle Policy Modeling book, and an example of how to use the Search Extension working together with another JavaScript Extension (in this case, an Entity Collect) appears on this page.

Author: Richard Napier

After 8 years in case management and ERP software roles, Richard Napier joined Siebel Systems in 1999 and took up the role of managing the nascent Siebel University in Southern Europe. He subsequently was Director of Business Development and Education for InFact Group (now part of Business & Decisions) for 8 years. He now runs Intelligent Advisor IT Consulting OÜ. Owner of, he also is Co-Founder of the Siebel Hub.

6 thoughts on “Siebel CRM as a custom Search source

  1. Hi Richard,

    I am not sure if you had this issue but if we try to build a loader while fetching values from external source in Rightnow for values entered in entities, the loader or the DOM element being created is being below the footer of the CP page. Do you think it is a code issue or an expected behaviour of OPA Javascript extensions?


    1. Hi There. Just let me repeat what I understood. You have an OPA Interview, and in the interview is searching for something in RIghtNow (Service Cloud). The results are showing in the wrong place (the bottom of the page andnot where they are supposed to). Is this a Search Extension, if so, the data coming from your external system is loaded into the dropdown through the callback. It sounds like it isnt a Search, so the placement of the data results is normally something you control. In your code, I would expect to see a document.createElement followed by some sort of appendChild() – the appendChild is what controls where your output is displayed. If you want to share the code of the extension I would be happy to take a look. And to answer your question, if you are using the JavaScript API it’s up to you where to place the response / the UI you generate. After all you can use jQuery to select whatever you want to use to display your stuff.

  2. Hi Richard,

    In the custom search example mentioned here, the OPA control gets triggered when the text box in the user screen is a single line text box. I had tried the same where the text box was changed to Mask and the search was not triggering. Is there any way to trigger the customSearch for masked input type?


    1. Hi There. The customSearch will not trigger unless the text box is a plain text input. There is a check in the interviews.js that verifies the Control Type so the code would not run if it is not a plain input box. There is also a “timer” so you cannot type too much text into the search box. So I don’t know how a mask would help you in that case.

      1. Hi Richard, Thanks for your response. We were trying to ensure the user enters in a particular format for e.g. XXX-XX-XXX and based on that custom search works. Problem with RegEx is that it doesn’t get invoked until the submit or next is clicked.

        Also, the custom search seems to trigger only if user is entering a value as we also tried copying the masked text to a text field and the customsearch was not triggering.

        1. Hi. I’m afraid that is not currently how the custom Search works. As you stated, the user must enter some text, without a mask, and the results are displayed in the drop-down list. It might be that you have to create a custom Input instead, or a custom Options , and manage the ajax call in the Validate. Cheers

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Intelligent Advisor IT Consulting Serving Customers Worldwide
Hide picture