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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use Hmap - JSON to XML

How to setup HMap to be able to create the XML from the following JSON?

0683p000009Lvqs.png

 

Input JSON

{
	"documentSection":{
		"documentStatus": 1,
		"documentNumber": "9300806055"
	},
	"partnerSection": {
		"partner_role_ag": {
			"partnerRole": "AG",
			"contactFirstName": "Mario"
		},
		"partner_role_lf": {
			"partnerRole": "LF",
			"contactFirstName": "Anna"
		},
		"partner_role_we": {
			"partnerRole": "WE",
			"contactFirstName": "Mia"
		}
	}
}

Output XML:

<ORDER>
	<HEAD>
		<DOC_STATUS>1</DOC_STATUS>
		<DOC_NO>9300806055</DOC_NO>
		<PARTY>
			<PARTNER_ROLE>AG</PARTNER_ROLE>
			<NAME1>Mario</NAME1>
		</PARTY>
		<PARTY>
			<PARTNER_ROLE>LF</PARTNER_ROLE>
			<NAME1>Anna</NAME1>
		</PARTY>
		<PARTY>
			<PARTNER_ROLE>WE</PARTNER_ROLE>
			<NAME1>Mia</NAME1>
		</PARTY>
	</HEAD>
</ORDER>

 

Labels (1)
  • Other

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I enclosed a map and a job to do this transform.


THMAP_JSON_XML.zip

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Hi,

 

How do you get this JSON input ? Do you read it on a file system ? Does it come from a webservice call ? ...

 

Eric

Anonymous
Not applicable
Author

web service call, but why does that matter?

Anonymous
Not applicable
Author

I enclosed a map and a job to do this transform.


THMAP_JSON_XML.zip
Anonymous
Not applicable
Author

Are there any good example & documentation on how to use tHMap? I remember that 6 months ago there were almost no examples.