Connector Dialog for OData - How to load data from Function Import

Perform the steps below if you get this error in OData Connector form: 

Entity couldn't be found in Metadata. If this is a Function Import, please refer to the documentation on how to properly query the data.

To replicate the error in DPS:

  1. Create a new connection to OData and connect to this Collection URL: http://services.odata.org/V4/TripPinService/

  2. Click the Retrieve button

  3. From the list of Collections, select GetNearestAirport

The following error message displays: Entity couldn't be found in Metadata. If this is a Function Import, please refer to the documentation on how to properly query the data.

If the base entity set of a function import is available in the list of Collections, then we can retrieve data using the Connector form. 

Steps

  1. Determine the kind of collection selected in DPS. 

    In our example above, the selected collection is GetNearestAirport.

    From a browser, go to this URL: http://services.odata.org/V4/TripPinService/. This will list the available collection:

     

    From the list, “GetNearestAirport” is a kind of “FunctionImport”.

  2. Determine the base EntitySet of the Function by inspecting the metadata.

    From the browser, go to https://services.odata.org/V4/TripPinService/$metadata to display the entity data model of the OData service. Search for “GetNearestAirport” on the page and look for the EntitySet value.

     

    The EntitySet for “GetNearestAirport” is “Airports”.

  3. If the Entity Set “Airports” is in the Collection list, then we can use that collection to retrieve the data from the said Function Import. See Step 1.

     

  4. Go back to DPS, from the list of Collections, select Airports and click on Preview Data. This will list all the data from the Airports collection.

     

  5. Since the Entity Set of GetNearestAirport is Airports, we can use the fields of Airports collection to retrieve the data of this function import.

    Edit the generated OData Query URL, remove the Collection Name and replace it with the function with the required parameters. Parameters can be checked from the metadata (see step 2):

     

    OData Query URL: http://services.odata.org/V4/TripPinService/Airports?$inlinecount=allpages. Edited Query URL with function import and parameters: http://services.odata.org/V4/TripPinService/GetNearestAirport(lat = 33, lon = -118)

  6. Click on Preview Data to retrieve records returned by the function import.

     

Note that if you change the selected Collection, the modifications made in OData Query URL will be gone and changed to the auto-generated query URL. 

 

 

© 2024 Altair Engineering Inc. All Rights Reserved.

Intellectual Property Rights Notice | Technical Support