🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Regarding Data to JSON operator for proper JSON output

User: "San"
New Altair Community Member
Updated by Jocelyn
I am using readdatabases operator and querying the data.I am getting json data in one column of example set as a result but when i try to again convert data to json it is adding / \ slashes to each value and attribute in json. Can anyone help me how can i eliminate that and get the json data as it is displayed in the exampleset attribute column

Find more posts tagged with

Sort by:
1 - 10 of 101
    User: "BalazsBaranyRM"
    New Altair Community Member
    Hi,

    this is the expected behaviour. In your case, you already have JSON data. Data to JSON doesn't know that, it handles your JSON attribute as a normal text attribute, and converts it *again* into standard JSON, which has to escape the "s with \. 

    You could split up your example set: select all attributes but the JSON one into one table, keep the JSON attribute in another, keep a common ID (maybe create it with Generate ID if you don't have one) and join later for example.

    Best regards,
    Balázs
    User: "San"
    New Altair Community Member
    OP
    Hi, actually there is only 1 column in my example set that has the json data.. but I need the example set in json so how do I split up? Or how do I do it?
    User: "BalazsBaranyRM"
    New Altair Community Member
    Hi!

    So you already have JSON data? Why are you using "Data to JSON" then? 
    I don't understand what you need by "I need the example set in json so how do I split up".
    Either you need the JSON, you already have that.
    Or you want so split up into different attributes. Use JSON to Data (from the Text Processing extension) for that, or the functionality in the database if that exists. There's also Extract Information where you can use JSONPath to access parts of your document.

    Regards,
    Balázs
    User: "San"
    New Altair Community Member
    OP
    Hello, 
    Actually, what I meant is... I am getting whole JSON data in single column in Exampleset. But what I want is the actual JSON structure with JSON data as output. Not the JSON data present in table......
    User: "BalazsBaranyRM"
    New Altair Community Member
    Can you provide examples? What you have, what you want?
    User: "San"
    New Altair Community Member
    OP
    Updated by San
    Hi, 
    For better understanding I am attaching a picture here, Please do take a look. Below picture is the output of Read database operator which is Exampleset. But What I am expecting is actual JSON structure with JSON format as output. 
    User: "BalazsBaranyRM"
    New Altair Community Member
    You already have an actual JSON structure with JSON format in the syselement attribute. Please explain what problem you're trying to solve.
    User: "San"
    New Altair Community Member
    OP
    Hi, yes but I need to do data to json to that because the json is in example set format and in attribute syselement. I want it as a fresh only json like what we get when we do data to json 
    User: "BalazsBaranyRM"
    New Altair Community Member
    Hi,

    you can use "Data to Documents" to convert the example set format to a collection of documents, similarly to "Data to JSON". 
    Use "Nominal to Text" to convert the JSON attribute to a text attribute, and "Data to Documents" will pick it up.

    Regards,
    Balázs
    User: "San"
    New Altair Community Member
    OP
    Thank you will try it out