Question

2
Replies
2536
Views
jkchua Member since 2018 6 posts
-
Posted: April 3, 2019
Last activity: April 3, 2019
Closed

Converting JSON to Clipboard

Hello :)

I am having trouble parsing the JSON data that I have to Clipboard. The following JSON contains the following structure (response trimmed for brevity but it's still valid JSON):

{  
   "data":{  
      "products":{  
         "161630882":{  
            "addedBy":"SYSTEM",
            "creationDate":"2019-03-28T10:33:34.787"
         }
      },
      "orderProducts":{  
         "161630882":{  
            "bundleId":101930536,
            "bundleOrder":5000
         }
      }
   }
}

However, @(Pega-RULES:Page).pxConvertStringToPage(tools,myStepPage,.Response,"json") returns an error with "The reference 161630882 is not valid. Reason: invalid property name: '161630882'". adoptJSONObject function returns the same error.

So the question is: If Pega is unable to parse integers as properties, how can we be able to convert this JSON to clipboard? Note that we cannot modify the structure of the JSON as that same structure is being used in multiple areas of our systems.

Any help is appreciated! :)

Low-Code App Development Low-Code App Development Dev/Designer Studio
Moderation Team has archived post
Share this page LinkedIn