Create a form action to call the web service

In this step, you create an action that will call the DVLA Search web service and populate the fields in the Vehicle Data object variable

  1. On the Actions tab, click New.
  2. Select RESTful service as the Type.
  3. Enter GetVehicleDetails as the Name.
  4. Select DVLA Search as the Web service.
  5. Enter the following text in the URL parameters editor:

    DvlaSearch?apikey=DvlaSearchDemoAccount&licencePlate=

  6. The value of Licence Plate is based on the value in the textbox control. Therefore, right-click in the editor and select the txtLicencePlate textbox.
  7. Select GET as the Verb.
  8. Select JSON as the Type.
  9. Select Variable as the Response type.
  10. Select the Vehicle form variable as the Value.

  11. Click Add.

    When the web service executes it returns JSON, and that data is used to populate matching fields in the object (where a matching name and type exist).

  12. Call the action on the button click:
    1. Go back to the form Design tab.
    2. Select the Get Details button control.
    3. In the button properties, select the Events tab.
    4. Click the Clicked event link, click Add to add the GetVehicleDetails action that you just created, and then click Done.
    5. Click Save.