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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Problem tXmlMap and null value

I have this structure
Database-tXmlMap-tRestClient to convert xml to json....I have a problem because if i have null value, tRestClient convert null value with "" for example
"chiave":"" this is not correct i will "chiave":"null"
I have try another structure
tDatabase-tWriteJsonField but i have multiple errore for example impossible to convert map(string,sting) to map(string,date) and is impossible to execute this operation

0683p000009MEhV.png
If i have
database-txmlmap-trestclient is possible to insert null value??
Is possibile to use 
Database-tWriteJsonField and resolve the problem of field date?
Labels (5)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Found the solution.
If you got the same problem, in tXMLMap, go to Settings in output part then select "false" for the option "Create empty element".
As empty elements are not sended any more with this option activated, the service now receive null values for the corresponding fields.
That's what I want.
Regards,
Fred

View solution in original post

5 Replies
Anonymous
Not applicable
Author

What you want is actually not correct because "null" mean nothing else than a String with the content "null". In JSON or XML you have only the chance to leaf the attribute out completely or write an empty string.
Anonymous
Not applicable
Author

This is a problem, the component for generate Json are wrong..because txml generate null field with "" but a web service use the controll 
if( field == null || ...ecc---all web service
tWriteJsonField generate all field with string value but all web service will deduce the type of a field in base of the syntax of the field....i use a tjava with json library but is not a good solution
Anonymous
Not applicable
Author

Serve a new component
TRF
Champion II
Champion II

Hi,
I have the same problem with tXMLMap (null values changed to "").
Does anyone has a solution for that?
In my case, I have a flow issued from an Excel file transformed to XML by tXMLMap then push to tRESTClient which call a service with JSON content:
tFileInputExcel --> tXMLMap --> tRESTClient
Received messages by the service contain for example "lastContactAdded":"" but "lastContactAdded":null is expected.
Regards,
Fred
TRF
Champion II
Champion II

Found the solution.
If you got the same problem, in tXMLMap, go to Settings in output part then select "false" for the option "Create empty element".
As empty elements are not sended any more with this option activated, the service now receive null values for the corresponding fields.
That's what I want.
Regards,
Fred