Getting Data Returned from a Service Action

The service actions are Function, Services Builder Task, and Web Service. When you add a service action to an event, you can map data to the inputs of that action. To get the data that is returned, you need to use another action to map it to a control in your application. There are two ways to accomplish this: you can make the action part of the same event as the one triggering the service action, or part of a different event.

To map the returned data to your application immediately, or as part of the same event, any actions in your event that come after the service action will have the result of the service action in the Eligible Data list. To map the returned data to your application later, or as part of a separate event, you would need to assign the result to a global variable, and then, once the event with the service action and the assignment action had been processed, the assigned global variable would be eligible to be mapped.

For example, if you were using a Web service in your application that, given a zip code, returned a temperature, it would take two steps to get that data. The first step is to send the zip code using a Web Service action, and the second is to display the returned value using a Display Form action.

To get data returned from a service action
  1. Create an event, and add a service action to it.

    For details about adding service actions, see the specific procedures for adding them. The service actions are Function, Services Builder tasks, and Web Service.

  2. In your application, add a control to display the returned value.

    For details about how to add a control, see Adding Controls.

  3. Map the result of the service action to the control that you want to display the returned value.
    To
    Do this
    Make this action part of the same event as the one triggering the service action
    1. Open the event in the Event editor.

    2. From the Event Steps tree, select the Display Form action.

      If there is no Display Form action listed, add it from the Basics part of the Actions list, after (below) the service action.

    3. From Display Form Properties, select the form that contains the control that you want to display the returned value.

    4. Click the Assign Form Inputs button.

      The Assign Form Inputs dialog box appears, showing the eligible data on the left and the available inputs for the selected form on the right.

    5. Under Eligible Data, select the output for the service action.

    6. Under Form Inputs, select the control that you want to display the returned value.

    7. Click the Add Mapping button.

    8. Click OK.

    Make this action part of a different event
    1. Open the event that includes the service action in the Event editor.

    2. Assign the output for the service action to a global variable.

      Add the Assignment action after (below) the service action. For details, see Assigning Global Variables in Events.

    3. Create a new event, one that will occur in your application at some point after the event with the service action is triggered.

    4. From the Event Steps tree, select the Display Form action.

      If there is no Display Form action listed, add it from the Basics part of the Actions list, after (below) the service action.

    5. From Display Form Properties, select the form that contains the control that you want to display the returned value.

    6. Click the Assign Form Inputs button.

      The Assign Form Inputs dialog box appears, showing the eligible data on the left and the available inputs for the selected form on the right.

    7. Under Eligible Data, select the global variable that you previously assigned to the output for the service action.

    8. Under Form Inputs, select the control that you want to display the returned value.

    9. Click the Add Mapping button.

    10. Click OK.

Related Topics
Bullet Adding Events, Overview
Bullet Assigning Global Variables in Events
Bullet Adding Functions to Events
Bullet Adding Services Builder Tasks to Events
Bullet Adding Web Services to Events
  Attachmate