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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] tXmlMap Find node based on attribute value

I'm not very familiar with XML.  I've been using tXmlMap to parse a response coming from a tRestClient into a database.

There is an array within the xml that contains multiple values I need to include.  Everything else maps across just fine, no problem.

We have a couple custom fields that the attribute "name" determines what the custom field is.  I need to be able to extract both the "job number" and "customer name" into a CSV output.  I don't think this is a loop since i need both custom_fields.
How do I structure the document so I can pull out both?  Should I be using a different component than a tXmlMap?

XML Structure
<issue>
<id>7774</id>
<project id="106" name="Data Management"/>
<tracker id="1" name="Bug"/>
<status id="7" name="Backlog"/>
<priority id="2" name="Normal"/>
<author id="60" name="Steven Baer"/>
<parent id="7773"/>
<subject>Subtask1</subject>
<description></description>
<start_date>2016-02-27</start_date>
<due_date/>
<done_ratio>0</done_ratio>
<is_private>false</is_private>
<estimated_hours/>
<custom_fields type="array">
<custom_field id="1" name="Job Number">
<value>25735</value>
</custom_field>
<custom_field id="2" name="Company Name">
<value>Test Company 1</value>
</custom_field>
</custom_fields>
<created_on>2016-02-27T10:13:45Z</created_on>
<updated_on>2016-02-27T10:13:45Z</updated_on>
<closed_on/>

</issue>

Trying to output to:
Id, CompanyName, ProjectName, ProjectId, JobNumber, Subject, Description, AuthorId, AuthorName, etc.
7774, Test Company 1, Data Management, 106, 25735, Subtask1, , 60, Steven Baer
Labels (4)
2 Replies
Anonymous
Not applicable
Author

Hello sbaer,
You can use tExtractXMLField to do in your job.
0683p000009MDNt.jpg
Anonymous
Not applicable
Author

The tExtractXMLField worked perfectly.
I wish you could do this within the tXMLMap component because I have some additional functions and cleanup I need to run once I extract the XML fields.  Would have been nice to just do that on the right side of the tXMLMap.  But I'll just pass this into another Map or JavaRow and make it work there.
Thanks for your help.  Much appreciated.