Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Response Of tRestClient as XML

Hi all,

 

I am using trestclient to fetch my api.

 

this is data after fetch

 

 

<?xml version="1.0" encoding="UTF-8"?>
<query-response>
  <data-table count="1" filter="VISITID_QUERY">
    <columns>
      <column>Visit</column>
      <column>Line</column>
      <column>Vel Name</column>
      <column>Vel Class</column>
      <column>I/B yg</column>
      <column>O/B Vy</column>
      <column>Pse</column>
    </columns>
    <rows>
      <row primary-key="32116">
        <field>M02</field>
        <field>MK</field>
        <field>MKA</field>
        <field>A</field>
        <field>19</field>
        <field>02</field>
        <field>In</field>
      </row>
    </rows>
  </data-table>
</query-response>

 

i wanna use this data in other element for example i wanna take first field, how can use that ?

i tried use tXMLmap but the data show as string not XML 

Labels (2)
1 Solution

Accepted Solutions
nivedhitha
Creator III
Creator III

Hi @Turki,

 

pass the xml response to textractXMLField component and give "/query-response/data-table/rows/row" in the loop Xquery path and "field" in the xpath query and in the XML field choose the column that has the xml string. output schema for the extactxml component would be the strings you want to extract from the response.

 

 

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Put a tConvertType before your tXMLMap and convert String to Document

ashif2
Creator II
Creator II

Evansdar is right .

 

Here is the code snippet. 

 

 

0683p000009M2Cb.jpg

Anonymous
Not applicable
Author

Evansdar and Ashif thanks for reply.

Ok after convert how can I interactive with field?
for example I want to take first field "M02" from my response, How can I do that ?
nivedhitha
Creator III
Creator III

Hi @Turki,

 

pass the xml response to textractXMLField component and give "/query-response/data-table/rows/row" in the loop Xquery path and "field" in the xpath query and in the XML field choose the column that has the xml string. output schema for the extactxml component would be the strings you want to extract from the response.