Getting null tags in xmlString

Hello Team,

I am getting a JSON string as input in which some of the fields are optional but source system sends null as part of it. When I am trying to convert it to xmlString,
I am getting null tags as well which I don’t want to receive.

I can overcome this situation by checking null value, if not null, assigning it to a different doc and then convert it to xmlString but there are so many fields as
input so I don’t want to follow this one. As part of wmpublic.xmldocumenttoxmlstring BIS we have input parameter properties like generateRequiredTags,generateNilTags.
I tried to set both as true in one case and false in other case but still I am getting null tags.

Ex.

Input JSON String:

{
“input”:
{
“a”:“a value”,
“b”:“b value”,
“c”:null
}
}

XML String:
a valueb value

Expectation:
a valueb value

Kindly help.

Hi Anil,

is field c markeds as required or not.
When a field is marked as required, but can be empty it should be declared as nillable (“allow null” in Designer) to get an empty tag for satisfying validation.

Can you share the definition of the document input with the exact field constraints?

Are there any mappings in to downstream?
If so, you can use Copy Conditions on these fields and only map them when they have a meaningful value.

Regards,
Holger