Back

Using a Data Connector


Data Connectors can be called in server events to interact with a web service.

To call a Data Connector it must first be added to the entity's Data Connectors View. If a Data Connector is added to a Form, server events in the Form's Pages and Controls can also call the Data Connector. 

A Data Connector can be added by dragging it into the Data Connectors View from the Entity Tree, or by clicking on Add Data Connector in the Data Connectors View and selecting the Data Connector from a list. 

Once added, functions defined in the Data Connector can be called in server event scripts.

  • Functions in Data Connectors created in the Verj.io Studio can be called using the syntax: connectors.dataconnectors.<data_connector_name>.<function>(...).
  • Functions in Data Connectors downloaded from the Resource Hub can be called using the syntax: connectors.verjio.<data_connector_name>.<function>(...)

In the following example car details are added to a Field by calling a carDetailsLookup Data Connector created in the Verj.io Studio. The getCarDetails(...) function of carDetailsLookup accepts a car registration number and returns the car's details:

fields.car_details.value = connectors.dataconnectors.carDetailsLookup.getCarDetails(fields.car_reg.value);