Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW

REST connector does not recognize XML format

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Sonja_Bauernfeind
Digital Support
Digital Support

REST connector does not recognize XML format

Last Update:

Feb 24, 2021 4:45:26 AM

Updated By:

Daniele_Purrone

Created date:

Jun 14, 2019 11:05:15 AM

When loading XML response from an API source with Qlik REST connector, Qlik Sense fails to recognize the XML response and shows error "Cannot parse data in the selected response type. Check the "Response type" parameter value. XML was not found". The file works fine when loaded directly, the issue only happens when loading it via the REST connector.
The XML response is very simple with only one element, for example the following:

<count>123456</count>


Cannot parse data in the selected response type. Check the

Cause:

REST connector is unable to parse the response because it does not contain any element (only a single value) under root (<count>). Qlik REST connector takes the root element of an XML response as the parent data table, therefore the XML response must contain at least one child element under root.

Environment:

  • Qlik REST connector all versions

 

Resolution:

 

To fix the issue, please consider one of the following solutions:

  1. Modify the API source to return the only value in a child element under root. For example <data><count>123456</count></data>
  2. Load the response as CSV into a single field, then use TextBetween() function to get the necessary value. Sample script is as follows:

LIB CONNECT TO 'REST_API_source';
[CSV_source]:
LOAD TextBetween(col_1,'<count>','</count>') as count;
SQL SELECT 
    "col_1"
FROM CSV (header off, delimiter ",", quote """") "CSV_source";

Labels (1)
Contributors
Version history
Last update:
‎2021-02-24 04:45 AM
Updated by: