appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Bug]: Rest API: smart JSON substitution failure when escaping double quote from in return value from JS object

Open sumitsum opened this issue 3 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

From community:

JS function:

    jbItemsToHalo: () => {
        let rooms = jbGetProjectRooms.data.map(
            (room,idx) =>  {return{"name": room.name,"item_id": 1,"isgroupdesc": true, "group_id":idx + 1} }
        );
        let items = jbGetProjectItems.data.line_items.map(
            item =>  {
                let group = rooms.filter(r => r.name == item.room.name)[0].group_id;
                return{"name": item.short_description,"item_id": 1,"isgroupdesc": false, "group_id":group}
            }
        )
        return rooms.concat(items)
}
This returns an array of JSON objects that get inserted into the body of a POST request. It fails when one of the JSON objects contain a double-qoute within a string, and Smart JSON Substitution is on, but it works when it is off.

im1 im2

Steps To Reproduce

As given in description.

Public Sample App

No response

Version

cloud

sumitsum avatar Mar 12 '22 12:03 sumitsum