Support Article
getJSON methods converts to data into string values
SA-22680
Summary
User has a requirement to retain the Property values in their own data types. However, getJSON converts all the values into string values.
For example:
{"ServiceFee": {
"Amount": "200.25",
"CurrencyCode": "USD"
}}
In above response generated by getJSON, Amount is a property of decimal. But it was returning as String.
Error Messages
Not Applicable.
Steps to Reproduce
Convert a Clipboard Page that contains Decimal OR Date Properties. It would be converted into String values.
{"ServiceFee": {
"Amount": "200.25",
"CurrencyCode": "USD"
}}
ServiceFee : clipboard page
Amount : decimal value
CurrencyCode: string
Root Cause
A software use or operation error.
Resolution
Perform the following local-change:
Change Map From to JSON and then Pega retains context to type.
Hers's how the output looks :
{"ServiceFee": {
"Amount": 200.25,
"CurrencyCode": "USD"
}}
Published May 1, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.