Forum

HomeHomeCoreCoreGeneralGeneralAction: Assignment - BUG - JSON StringAction: Assignment - BUG - JSON String
Previous
 
Next
New Post
2/29/2016 6:30 PM
 

Hi there,

When assigning the following JSON string to an action variable, part of the JSON seems to be remove as part of the assignment.  Here is the JSO string.


JSON String

----------


{
    "productNumber": 1,
    "details": [
        {
            "Product": "Product Name",
            "statusCode": "in-stock",
            "otherDetails": [
                {
                    "selections": [
                        1,
                        "F"
                    ],
                    "cost": 1.04
                }
            ]
        }
    ]
}


JSON String After Assignment (Notice how the "selections node has been stripped of its details)

--------------------------------------------------------------------------------

{
    "productNumber": 1,
    "details": [        
        {
            "Product": "Product Name",
            "statusCode": "in-stock",
            "otherDetails": [
                {
                    "selections": ,
                    "cost": 1.04
                }
            ]
        }
    ]
}

Any ideas why this would happen?? The data comes from a web service which is then saved to an action variable and stored in the DB BUT why does OWS strip parts of it away during the Action:Assignment

Here is the Debug Output


64. (Expand/Collapse)Assignment variable 'JSONString' to '{ "productNumber": 1, "details": [ { "Product": "Product Name", "statusCode": "in-stock", "otherDetails": [ { "selections": [ 1, "F" ], "cost": 1.04 } ] } ] }'. Assignment: Action[JSONString] = '{ "productNumber": 1, "details": [ { "Product": "Product Name", "statusCode": "in-stock", "otherDetails": [ { "selections": , "cost": 1.04 } ] } ] }'
New Post
3/17/2016 4:25 AM
 

Hi,

As F can be used as shortcode for Form, is it possible that the [1,"F"] is being treated as a reference to a Form variable named 1. Same as [1,Form]

Just a thought

Tony

New Post
4/22/2016 10:52 PM
 
yes, that was the problem. Best thing to do if you're working with JSON in OWS is to escape it using the {Escape} formatter. That seemed to fix my issue
Previous
 
Next
HomeHomeCoreCoreGeneralGeneralAction: Assignment - BUG - JSON StringAction: Assignment - BUG - JSON String


 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seattle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share