Search widget
Search widget prefill
When the Search widget is embedded in your internal application, it can be configured to do the same search most recently performed in your app. Web developers can add properties to the widget code to populate the widget with the same search terms.
For example, before adding an account, business processes might require you to search a downstream system like Service Cloud for an existing account. If a match isn't found, you can use the Search widget to see if the account exists in Network or OpenData. To avoid entering the same data twice, the Search widget can be set to automatically search for the terms that you just entered in your downstream system.
This enhancement is not enabled by default. Web developers can add this capability to their widget code.
Note: The Search widget configuration must support the Advanced Search form to use this enhancement.
Example
In this example, the search widget is embedded in an internal application. After a user searches locally for an HCP, they can launch the Search widget to search Network and OpenData for that HCP. The Search widget is configured to prefill the search form and automatically search for the terms that the user already entered in their internal app.
When the Search widget opens, the search results automatically display for those search terms.
Widget properties
To support this enhancement, two properties are available for the Search widget code:
-
pre-fill-search-form - Use this property to prefill the Search widget advanced form with the search terms that you used in your downstream system.
When you open the Search widget, the Advanced search form displays with the pre-filled search terms. You can add criteria and then click Search to view the results
-
auto-search - Use this property with the pre-fill-search-form to prefill the search form and automatically open the widget to the search results page.
Note: The auto-search property cannot be added to the widget code without the pre-fill-search-form property.
Add the properties
Web developers can add the properties to the veeva-network-search-widget element in the widget code.
Example widget code
Supported searches
When these properties are added, the search terms that you use in the downstream system must match the fields used in the Search widget.
Supported values
-
Entity type - Must be HCP or HCO.
If entity_type is not defined or is not HCP or HCO, the property is ignored.
Supported fields
All standard and custom fields for Veeva objects (HCP, HCO, Address, License, Parent HCO) are supported if they are used in the Advanced search form.
HCP Example
entity_type=HCP&hcp.first_name__v=Jack&hcp.last_name__v=Hughes&address.locality__v=Chicago
HCO Example
entity_type=HCO&hco.corporate_name__v=Barnes%2ASmith&address.locality__v=Chicago
Special fields
These fields are supported:
-
ID__s - Search by ID field
-
hashtags - Search by hashtag
Additional considerations
-
Each term is separated by the ampersand (&) symbol.
-
If a term has spaces, symbols, or special characters, they must be encoded.
-
All other fields are ignored.