18.4.7.10 Example: Creating a REST Data Source Against a Fusion Applications Endpoint

Learn how avoid an error when creating a REST Data Source against a Fusion Applications end point which uses selectively required attributes.

Some Fusion Applications end points identify a set of indexed attributes, at least one of which must be provided when retrieving the data. Since App Builder retrieves sample data from the endpoint when you define a REST Data Source, you may encounter an error when trying to use such an endpoint. This topic explains how to avoid the error during REST Data Source creation by configuring a filter that uses one of these selectively required attributes.

18.4.7.10.1 Create a REST Data Source for an Endpoint with Selectively Required Attributes

Create a REST Data Source against a Fusion Applications end point which uses selectively required attributes.

To create the REST Data Source:

  1. Navigate to the REST Data Sources page:
    1. On the Workspace home page, click App Builder.
    2. Select an application.
    3. On the Application home page, click Shared Components.
    4. Under Data Sources, select REST Data Sources.
  2. On the REST Data Sources page, click Create.
    The Create REST Data Source Wizard appears.
  3. Create REST Data Source - Select From Scratch and click Next.
  4. General:
    1. REST Data Source Type - Select Oracle Cloud Applications (SaaS) REST Service.
    2. Name - Enter a descriptive name for this REST Data Source.
    3. URL Endpoint - Enter the endpoint of the service with Selectively Required attributes, without providing any Query String (that is, no question mark and no parameter values at this step). For example:

      https://fa.com/fscmRestApi/resources/11.13.18.05/inventoryOnhandBalances

    4. Click Next.
  5. Remote Server - Accept the defaults and click Next.
  6. Settings, Pagination Type - Accept the defaults and click Next.
  7. Authentication, Authentication Required:
    1. Choose an existing credential if appropriate, or choose an Authentication Type and enter the relevant details for defining a new credential.
    2. Click Discover.

      The following error appears:

      HTTP Status

      Discovery error: Oracle APEX cannot compute a data profile from the response data of type: application/vnd.oracle.adf.resourcecollection+json.

      For this example, one of the following attributes is required: ItemNumber, OrganizationCode, InventoryItemId, OrganizationId

      To avoid this error, you need to create a filter for one for one attribute (for example, OrganizationId).

  8. Click the Back arrow (<) to return to the previous Authentication step.
  9. Authentication, Authentication Required:
    1. Re-enter your credentials.
    2. Click Advanced.
  10. On Parameters:
    1. Parameter Type - Select URL Query String.
    2. Parameter Name - Enter q
    3. Value of - Enter OrganizationId='0'

      Note:

      Adjust the example attribute name (for example, OrganizationId) to instead use the name of one of the selectively required attributes required by the endpoint you want to work with. The value on the right hand side of the equals sign is not important.
    4. Click Discover.
  11. On the Preview step, click Create REST Data Source.
    The REST Data Source is created.

18.4.7.10.2 Remove the Hard-Coded q Parameter

Edit the REST Data Source to remove the hard-coded q parameter and add a filter parameter for selectively required attributes.

To remove the hard-coded q parameter:

  1. On the REST Data Sources page, click the appropriate REST Source Name.
    The REST Data Source page appears.
  2. Delete the q parameter:
    1. Find Parameters.
    2. Find the q parameter and click the Edit icon.
    3. Click Delete.
  3. Add a Filter Parameter for selectively required attributes.
    1. Find Operations:
    2. Edit the GET operation with Database Action of Fetch rows.
    3. On the REST Source Operation page, find Operation Parameters and click Add Parameter.
    4. On Edit REST Data Source Parameter:
      • Type - Accept the default, URL Pattern.
      • Name - Enter the name of the parameter. For example, enter OrganizationId_eq$norowsifnull

        Be sure to enter the parameter name you specified when your created the REST Data Source.

    5. Click Add Parameter.
    6. On the REST Source Operation page, click Apply Changes.
    The REST Data Source page appears.
  4. Click Apply Changes again to complete the REST Data Source editing task.

    The filter parameter you added lets you declaratively bind a page item or other value to the selectively required attribute in any region where you use this new REST Data Source. For more information on Filter Parameters, see Filter Parameters for Query By Example and Parent and Child Use Cases.