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

Automations fail when using a property with JSON containing '

SA-61331

Summary



JSON is used to send complex data structures to an automation through a property. A string is constructed using the out-of-the-box JSON data transform.
Error occurs when using a special character ( ' ) in the JSON string when executing the automation from a flow action.



Error Messages



Error in the browser console:

'Uncaught SyntaxError: Unexpected end of JSON input'


Steps to Reproduce

  1. Create a TestJSON simple flow with a single assignment which calls a TestJSON flow action. Click bullseye to create and open the new flow action.
  2. In the TestJSON flow action, create TestAutomation (fictious name) for the 'Run robotic automation' field in the pre-processing panel (FYI RAS is not required). Set the SetProperty data transform in the pre-processing panel. Click bullseye to create and open the new data transform.
  3. In the SetProperty data transform, set TestValiue property to 'Test O'Test. Click bullseye to create TestValiue property as type Text. Save the property and close the property rule.relevant record'.
  4. In the data transform SetProperty, apply the SerializeJSON data transform. Click bullseye to create the data transform.
  5. During the creation of the data transform, select JSON data model format and click Create and open.
  6. In the SerializeJSON data transform, set the Clipboard to .TestValue and the JSON to TestValue. Save and close the data transform rule.
  7. Set the options of Apply data transform to pass parameters.
  8. Set TestValueJSON property to param.jsonData. Click bullseye to create Test ValueJSON property as type Text. Save the property and close the property rule.
  9. In the SetProperty data transform, Save and close the rule form.
  10. In the TestJSON flow action, Save and close the rule form.
  11. In the TestJSON flow, save and click the Record Test Case in the Actions menu.
  12. Open browsers console window and clear all content. Click Done.


The property tested must be added to 'relevant record'


Root Cause



If any relevant record has a single quote ('), the generated Java HTML attempts to break HTML data-automation-propData attribute and causes the exception. Replace the single quote with ASCII HTML entity to make data-automation-propData attribute friendly.

Resolution



Apply HFix-45356.

 

Published September 27, 2018 - Updated October 8, 2020

Was this useful?

0% 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