Creating dataservices

In order to load data into the Infor App Builder from your API, you must map available dataservices within the required components.

In order to use API endpoints as dataservices in App Builder, some mappings might be needed between the API input and App Builder properties.

  1. Click inside the component to open Properties, then click Manage Dataservices.
  2. If there is no current dataservice listed, then you must add one.
    The list is then populated with the user data.
  3. Click + Add Dataservice then select one of these options:
    • Create from API: Search the ION API registry of suites, then map the API to a dataservice.
    • Add from Repository: Add an already created dataservice from the repository to your project.
    • Import from File: Add an already created dataservice from the file system to your project.
    • Configure Dataservice Manually: Skip search and lookup and enter manually enter input and output parameters. The endpoint must still be an ION API endpoint.
    • Create BI Dataservice: Create a dataservice that maps an Infor Business Intelligence Query created in the Infor BI Query Editor.
  4. For the example described in Tutorial, select Create from API.
  5. From the Suite menu, select Infor Ming.leTM, then click Search.
  6. Filter by the GET HTTP method, then scroll down to select Get newly registered users, then click + Create Dataservice to open the dataservice mapper wizard..
  7. The Basic Request Information section shows the HTTP Method and the API Relative URL.
    To edit the API Relative URL, foe example, to correct something or to replace input parameter placeholders with static values, click the edit icon of the selected API.

    When the API input is a JSON object sent in the request body (typically the case when the HTTP method is POST or PUT), a sample object is typically provided for the selected API. Click VIEW JSON to view this object and also edit it if required. When executing the API from the dataservice, this will be the object sent as body input.

    The properties of the sample object can be mapped to App Builder parameters by the Input Parameters definitions. These mappings are constructed from JSON Paths identifying the property in the JSON object.

    You can also provide the JSON object with static data that you input into the API, but cannot be changed through the app you are currently building.

    Note: For help with constructing JSON Paths, click JSON HELP.
  8. The Input Parameters section shows the Name, Type, and an optional Alias of all input parameters currently set.
    Use the checkboxes to make parameters Mandatory.
  9. To add new input parameters, click + ADD then select one of these options from the menu:
    • Path Parameter: Add parameter mappings to the API path. The added parameter is reflected in the API Relative URL. For example:
      items/search/item/resource/Preview/stream/{path0}
      
    • Matrix Parameter: Add parameter mappings as matrix parameter to the API path. The added matrix parameter is reflected in the API Relative URL. For example:
      items/search/item/resource/Preview/stream;matrix0={matrix0}
      
    • Query Parameter: Add parameter mappings as query parameter to the API path. The added query parameter is reflected in the API Relative URL. For example:
      items/search/item/resource/Preview/stream?query0={query0}
      
    • Body (jsonpath) Paramter: Add a parameter mapping to the input JSON object. The locator of the JSON object property to the map is constructed from a JSON Path defined in the Name field of the input parameter. For example:
      $.queries.query[0].arguments.argument[0].value

    To remove input parameters, click the Trash icon.

  10. For this example, the userGUID parameter is used.
    For better visual representation in the UI, change the alias to 'Unique ID'.
  11. Click NEXT.
  12. Next, you need to define the output parameter mappings for the properties you want to use in the designer.
    The output of an API execution can be either a JSON object or a file stream. For the purpose of this example, it is a JSON object, which is used as a reference when you construct or edit the dataservice.

    You need to map the properties of the JSON object to the dataservice parameters used in App Builder

    1. First, you need to set the root level from where to lookup further defined output parameters. In this example, the output will be a list of items with these properties:
      • UserId
      • UserName
      • FirstName
      • LastName
      • Email
      The root element is therefore:
      $.ColleagueRelationshipList[*]

      From the defined root element level, you can then define the output properties to map.

    2. Click + Add, then set the name to a JSON path to the required property relevant to the root element definition, for example, .ColleagueInfo.UserId, then enter a UI friendly alias.
    3. Continue to map these JSON path definitions to provide output parameters for UserName, FirstName, LastName and Email:
      • .ColleagueInfo.UserName
      • .ColleagueInfo.FirstName
      • .ColleagueInfo.LastName
      • .ColleagueInfo.Email
  13. Click Next.
  14. Enter a name for the dataservice and an optional description, then click NEXT.
  15. Review the information, then click DONE.
  16. Click CLOSE.
    To get the UserGUID parameter, you need to create another dataservice:
    1. Select Infor Ming.leTM Suite and search for userdetail.
    2. Create a dataservice for "/SocialService.Svc/User/Detail"
    3. On response: Root Element = $ UserDetailList[0]
    4. Add output parameter Name:.UserGUID
    5. Name the dataservice Ming.le - Get Current User
    6. Optionally, add more dataservices for use in the tutorial.