cancel
Showing results for 
Search instead for 
Did you mean: 

pass parameter to custom query by REST call

Jay_Rosansky
Champ in-the-making
Champ in-the-making

Hi,

I need to pass a "where clause" parameter to a custom query.  Where is the documentation to do this?   Can you give a simple example?

 

Thanks.

Jay

3 REPLIES 3

Larissa_Armand
Elite Collaborator
Elite Collaborator

Hi Jay,

 

Have you looked at the documentation here? 

 

https://sdk.onbase.com/rest/docs.html?product=OnBase&release=Foundation22.1&spec=document#tag/Docume...

 

This shows how to add keyword criteria and/or date range criteria for a custom query. If that's not what you are looking for, what kind of criteria are you trying to add?

I have looked there.   I am would like to perform a wild character match on strings.   Something like SQL:

 

name LIKE '%important stuff%'

 

Where the "important stuff" is passed to the query through the REST call.

AdamShaneHyland
Employee
Employee

Hi @Jay Rosansky ,

 

From a quick test, you should be able to use a * as your wildcard for the Keyword Type value being used as the constraint in the Custom Query.

 

/onbase/core/documents/queries{  "queryType": [    {      "type": "CustomQuery",      "ids": [        "104"      ]    }  ],  "maxResults": 1000,  "queryKeywordCollection": [    {      "typeId": "1",      "value": "Test*",      "operator": "Equal",      "relation": "And"    }  ]}

 

... which will give you the queryId which can be used to generate the results.  For example ...

 

/onbase/core/documents/queries/{queryId}/resultsEx. /onbase/core/documents/queries/595e7bf3-2489-40f9-a86a-266c0e38afa8/results{    "items": [        {            "displayColumns": [                {                    "index": "0",                    "values": [                        "2147085298"                    ]                },                {                    "index": "1",                    "values": [                        "_ALS - Image - 9/24/2014 - TESTING - 2147095450.TIFF"                    ]                },                {                    "index": "2",                    "values": [                        "_ALS - Image"                    ]                },                {                    "index": "3",                    "values": [                        "TESTING"                    ]                },                {                    "index": "4",                    "values": [                        "MANAGER"                    ]                },                {                    "index": "5",                    "values": [                        "2014-09-24"                    ]                }            ],            "id": "2147085298"        },        {            "displayColumns": [                {                    "index": "0",                    "values": [                        "2147085303"                    ]                },                {                    "index": "1",                    "values": [                        "_ALS - Image - 10/24/2014 - 1 - SHANDS.TXT"                    ]                },                {                    "index": "2",                    "values": [                        "_ALS - Image"                    ]                },                {                    "index": "3",                    "values": [                        "TESTING"                    ]                },                {                    "index": "4",                    "values": [                        "MANAGER"                    ]                },                {                    "index": "5",                    "values": [                        "2014-10-24"                    ]                }            ],            "id": "2147085303"        }    ]}

 

Hope this helps.

Getting started

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.