Hi,
we have an issue with the new version of a!toJson rule.
The new function a!toJson skip all fields that aren't text from a CDT.
use case:
1- create CDT TST_toJson_17r1:
field 1: text1 - text
field 2: text2 - text
field 3: int - number (integer)
2 - using a!toJson_17r1(type!TST_toJson_17r1()) = "{"text1":"","text2":"","int":null}"
3 - using a!toJson(type!TST_toJson_17r1()) = "{"text1":"","text2":""}" <= the integer field is missing
This is happend also with date field (maybe other types are conserned)
if we try the same senario with a dictionnary, borh funtion act i n the same way:
- a!toJson({text1:"",text2:"",int:0}) => {"text1":"","text2":"","int":0}
- a!toJson_17r1({text1:"",text2:"",int:0}) => {"text1":"","text2":"","int":0}
the probleme occure only with CDTs.
the beavior of new toJson function is expected or it's a regression?
thank in advance
Discussion posts and replies are publicly visible
Hi Victor,
Did you got any solution or work around for this issue?
Good catch, may be a defect worth reporting to Appian support.
That is a 5 year old thread. Although the issue is still there in the current latest version but the workaround is to cast the null CDT into Map and then use a!tojson()
Yes this is 5 years old thread. I just show some replies to this thread in the recent discussion list and started responding without realizing that it's a very old. If you think it's irrelevant please ignore and move on.