Join us for an engaging webinar, as we unravel the potential of AI for revolutionizing document management.
Watch Now
Enable your employees to remain productive throughout the document management process.
Read More
Learn how SmartZone uses a regular expression engine integrated into the recognition engine to achieve the best possible accuracy on data that can be defined by a regular expression.
Docubee is an intelligent contact automation platform built to help your team success
With PrizmDoc, how can I hide a predefined search if there are no results?
The predefined search option does not support that functionality, but you can instead perform a server-side search, and then activate the search panel if there are results to show:
var viewer; var viewingSessionId = <%= viewingSessionId %>; var fixedSearchTerm = "the"; var pasUrl = "/pas"; var viewerReady = false; var searchReady = false; var searchDisplayed = false; function displaySearchIfNeeded() { // The search is only displayed once the viewer is ready, and once our preliminary server-side search comes back positive. if (viewerReady && searchReady && !searchDisplayed) { searchDisplayed = true; $("[data-pcc-search=\"input\"]").val(fixedSearchTerm); $("[data-pcc-search=\"submit\"]").click(); } } function sendSearchPost() { $.ajax({ "method": "POST", "url": pasUrl + "/v2/viewingSessions/" + viewingSessionId + "/searchTasks", "data": JSON.stringify({ "input": { "searchTerms": [ { "type": "simple", "pattern": fixedSearchTerm, "caseSensitive": false, "termId": "0" } ] } }), "contentType": "application/json", "success": function(response) { $.ajax({ "url": pasUrl + "/v2/searchTasks/" + response["processId"] + "/results?limit=1", "success": function(response) { if (response.results.length !== 0) { searchReady = true; displaySearchIfNeeded(); } }, }); }, "error": function(jqXHR, textStatus, errorThrown) { if (jqXHR.status === 480) { setTimeout(sendSearchPost, 2000); } } }); }; setTimeout(sendSearchPost, 500); $(document).ready(function() { // Since we are no longer restricted to a predefined search, we can load the viewer ASAP. viewer = $("#viewer").pccViewer({ "documentID": viewingSessionId, "imageHandlerUrl": "/pas", "language": viewerCustomizations.languages["en-US"], "template": viewerCustomizations.template, "icons": viewerCustomizations.icons }); viewer.viewerControl.on("ViewerReady", function(event) { viewerReady = true; displaySearchIfNeeded(); }); });