Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
May 10, 2022 3:14:14 PM
Mar 28, 2022 4:11:36 AM
Qlik Web Connectors support OData v4.0 and responses in JSON format.
This article documents a how-to scenario for Qlik Cloud. For an example using the Standalone Qlik Web Connectors, see Using OData Connector with OData v4.0 JSON Messages with Standalone Qlik Web Connectors.
Qlik Web Connectors
Qlik Cloud
Qlik Sense Business
Find the total revenue of each product from all orders using the example OData service: https://services.odata.org/V4/Northwind/Northwind.svc
The JsonV4ListResources table will return the available resources from your OData service.
You can use the values returned in the name column from the JsonV4ListResources table as the input to the OData Resource Path parameter on the JsonV4GetData table. For this example, we want to use the Orders resource.
The JsonV4GetData table will return the data from the resource specified in the OData Resource Path parameter
Note that collection valued properties are not returned by this table. A placeholder with the value “[Collection]” is returned instead. That data can then be retrieved by using the JsonV4GetDataCollection table. In cases where the collection values properties are also navigation properties, the placeholder that is returned is “[Collection]*”.
In this example, we want to obtain the data in the Order_Details collection for each order so we can calculate the total revenue by product. To do this we must use the metadata returned from the JsonV4GetData table and identify the following columns to be used as parameter values in the JsonV4GetDataCollection table:
The JsonV4GetDataCollection table will return the data from the OData collection specified in the OData collection column name parameter.
For this example, we also wish to expand the Product navigation property within the Order_Details collection to return the actual product name. To do this you will need to nest the $expand options and set the value of the OData Query Options parameter to $expand=Order_Details($expand=Product).
JsonV4GetDataCollection.Order_Details_Product_ProductName
Sum([JsonV4GetDataCollection.Order_Details_Quantity] * [JsonV4GetDataCollection.Order_Details_UnitPrice])
Hi!
Is it possible to override the OData connector in the script so that you can use a variable as input to the Auth header field?
Something similar to "WITH CONNECTION" when working with the REST connector.
Hi @E_Langlet !
You should be able to use the following OData params:
ODataConnector_CanAuthenticate:
LOAD *
FROM [$(CONNECTION-NAME-HERE)]
(URL IS [https://qwc1.qliktech.com/data?connectorID=ODataConnector&table=CanAuthenticate&oDataServiceRoot=https%3a%2f%2fservices.odata.org%2fV4%2fNorthwind%2fNorthwind.svc%2f&acceptContentType=application%2fjson&authType=AuthHeader&authHeader=sta_gen_1%3apcLjnVBzDQvNBazWksL3iA%3d%3d%3a7Sjoiyf3Cwe1khAmwvBq3w%3d%3d&appID=&loadAccessToken=vCy6JxRQGj], qvx);
Note that the authHeader is encrypted, and you can get the encrypted value using the Helper connector (https://help.qlik.com/en-US/connectors/Subsystems/Web_Connectors_help/Content/Connectors_QWC/Data-So...
Cheers!
Hello @Sweta_Sharma,
Is it still relevant ?
I'm trying to generate qvd files in a loop, and I can't figure out what script I should use to make the OData connections, I have a vTableName variable.