Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

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

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us