Overview of Lookup Behavior
Lookup Behavior in WizyVision automates data entry by automatically filling fields with relevant information. When the value of a specific field changes, WizyVision triggers the Lookup Behavior process.
WizyVision sends a request to the Lookup Service, which then fetches data from an external source using the field's key and value. The Lookup Service prepares a JSON response with the retrieved data.
WizyVision receives the JSON response and auto-fills target fields based on the provided data. This seamless integration with existing systems like CRM or ERP streamlines data capture, enhances efficiency, and reduces errors.
Defining Lookup Requirements
Before building the Lookup Service, it's essential to define the requirements for data retrieval and integration with your WizyVision application. Here are the key steps to consider:
-
Identify Data Source: Determine the external data source (e.g., CRM, ERP, spreadsheet) from which the Lookup Service will fetch information. Understand the data structure, endpoints, and authentication methods of the source system.
-
Field Mapping: Define the mapping between the fields in WizyVision and the corresponding fields in the external data source. Ensure that the field keys and values are aligned to facilitate accurate data retrieval.
-
Data Filtering: Decide on any specific filtering or search criteria to fetch the relevant data from the external system. Consider parameters like unique identifiers, tags, or categories to retrieve specific records.
-
JSON Response Format: Establish the JSON response format that the Lookup Service will provide to WizyVision. Include custom messages and key-value pairs for field keys and their corresponding values.
-
Authentication: Determine the authentication method required by the external data source. This may involve API keys, OAuth tokens, or other authentication mechanisms.
Setting Up the Web Service
To build the Lookup Service, you need to set up a web service that will handle the data retrieval and response generation for the Lookup Behavior. Here's how to get started:
Choosing the Technology Stack:
Select the technology stack that best suits your requirements and existing infrastructure. Common choices include Node.js, Python, Java, or PHP. Consider factors like performance, scalability, and compatibility with your data source.
What Data Will I Receive on My Lookup Service?
When WizyVision triggers the Lookup Behavior, your web service will receive a structured HTTP request with essential data in the query section of the URL. The breakdown of this data includes:
- namespace: Account ID
- appId: ID of the Application where the lookup happened
- fk: The key of the field where the lookup happened
- fv: The value of the field that triggers the lookup (fk)
- lang: Language code of the user
- uId: ID of the user
How to Structure the Data in the Lookup Service Response?
The Lookup Service should prepare a JSON response with the following format:
The "message" key in the response allows you to include a custom message that will be displayed in the response dialog in WizyVision when it receives the response from your Lookup Service. This feature is useful for informing the user of any extra steps or actions required. For example:
- "Product found! Confirm the price tag if correct."
- "Product not found. Please try rescanning the barcode."
By providing a custom message, you can guide users through the data capture process, ensuring a smooth and intuitive experience within WizyVision.
The "data" object includes keys of the fields to update in WizyVision and their corresponding values. The data type of the value will depend on the field data type. For example, for a toggle field, the value should be a boolean, while for a dropdown field, it should be a string.
Ensure that your response adheres to the appropriate data types, as listed in the table below:
Data type |
Request data type |
Response format |
Note |
---|---|---|---|
Toggle |
NOT APPLICABLE |
boolean |
|
Checkbox |
NOT APPLICABLE |
Array<String> ["checkbox 1", "checkbox 2"] |
|
Date |
String |
String |
Dates should always be in ISO UTC format |
Number |
String | Number |
Number |
|
Location |
String |
{
"info": String | 'location display'
"geoPoint": {
"lat": double,
"lon": double
}
} |
|
Dropdown |
String |
String |
|
Text |
String |
String |
|
Paragraph |
NOT APPLICABLE |
String |
|
People |
String Ex: 'USER,1' |
{
"type": "ROLE" | "USER",
"id": number
} |
The request datatype will be in form of comma separated of id and id Public API - TODO - ADD LINK TO PUBLIC API |
People List |
NOT APPLICABLE |
NOT APPLICABLE |
|
Signature Field |
NOT APPLICABLE |
NOT APPLICABLE |
The list of possible values can be found trough our public APIs depending on the parser of the query parameters, the request data type could be Number or String. |
Status |
String | Number |
Number |
Status id |
Privacy |
String | Number |
Number |
Privacy id |
Deployment
Choose a Publicly Accessible Hosting Infrastructure: Select a hosting environment that allows your web service to be publicly accessible. This is crucial to enable WizyVision to send HTTP requests to your Lookup Service. Common options include cloud platforms like AWS, Azure, or Google Cloud, or you can use a dedicated server.
Secure Using the Authorization Header: As an added layer of security, you can implement authorization for your Lookup Service. This is achieved by using the Authorization header in the HTTP request sent by WizyVision. The header can contain a token or API key, allowing your Lookup Service to validate the request's authenticity and respond only to authorized requests.
Integrating with WizyVision
To integrate your Lookup Service with WizyVision's Lookup Behavior feature:
-
Get Lookup Service URL: Obtain the public URL of your deployed Lookup Service.
-
Access Admin Settings: In WizyVision, go to Admin → Applications.
-
Choose Application: Select the specific application you want to set up Lookup Behavior for.
-
Edit Source Field: Navigate to the Fields section and edit the field that will be the source of the Lookup Behavior.
-
Configure Lookup Tab: In the field settings, go to the Lookup tab.
-
Fill in URL: Enter the Lookup Service URL in the designated field.
-
Optional: Authorization Header: If your Lookup Service requires authentication, include the Authorization header value.
-
Save and Test: Save the settings and test the integration to ensure it works as expected.