Add a RESTful Service action

Use a RESTful web service to integrate your form with external applications.

Note TotalAgility only supports simple types of RESTful web services; therefore, they should not be used with complex data structures.

  1. On the Form Modeling bar, click Actions.
  2. On the Actions page, click Add Generic Add.
  3. On the Type list, select RESTful Service.
  4. Enter a Name and Description for the action.
  5. Optionally, configure a unique action for each language separately. See Configure multilingual actions for a form or control for more information.
  6. To select a web service for your web service action, consume the web service in the Web Service box. Example: http://www.thomas-bayer.com/sqlrest/CUSTOMER.

    The base URL is automatically populated, based on the RESTful web service selected.

    Note You can reuse the base URL parameters by copying and pasting it in the base URL parameters of another restful services.
  7. If required, enter the URL parameters, which are optional parameters of type String that influence the returned results in the URL Parameters box. You can map the URL by consuming a single form or global variable of type String, or form field, or dynamically defining the URL as a combination of static value, variables, and form field.
  8. To retrieve the data:
    1. On the Verb list, select GET.
    2. In the Response group, do either of the following:
      • To map the entire output to a single form variable or global variable, click Variables and consume the variable of type String or XML in the Value box.

      • To define the elements to extract from it, click Expression, and provide the correct path using a static or dynamic value.

  9. To update, insert or delete the data:
    1. On the Verb list, select PUT to update, POST to insert or DELETE to delete the data.
      Note In case of PUT and POST, you can reuse the request by coping and pasting it in PUT and POST verb of another restful service.
    2. Under Request, do either of the following:
      • Map the entire output to a single form variable or global variable by consuming a variable of type String or XML in the Request box.

      • Define a combination of static text, and variables (consume the variables).

  10. On the Type list, select the request type (JSON or XML).
  11. To allow a job to suspend if an error is found and to display the error code, in the Error Handling group, do the following:
    1. Select Yes for Stop on Error. (Default: No; this means that the job will complete even if an error is found.)
    2. Specify a static value or consume the variable in the Error Code box.
  12. Click OK.

    The newly created action is added to the table.

  13. Click Save.
  14. Associate the action with the control to trigger this action. To call the RESTful Service action upon form load, associate the action with the form. See Associate an action with a form or control.

    When this action is triggered, the RESTful web service is executed and the output and status code are handled as configured.