I have a very simple JSON object in a text column:
{“out-0”:“Who is the king of Belgium? The current king of Belgium is King Philippe. He was born on April 15, 1960, and is the eldest son of King Albert II and Queen Paola. As King, he serves as the General of the Belgian army and has also been involved in promoting Belgian companies and establishing business relations with other countries.”}
When I do Query JSON Column on this with out-0 as the JSONata query it doesn’t return anything.
When I try the following Javascript it also doesn’t do anything:
// Parse the JSON string into a JSON object
const jsonObject = JSON.parse(p1);
// Extract the value associated with the key “out-0”
const result = jsonObject[‘out-0’];
// Now, ‘result’ contains the value you’re interested in
When I do an Excel formula it works, however I assume this will only work for very simple JSON objects.
Excel Formula: MID(A1, LEN(“{”“out-0"”:“”“) + 1, LEN(A1) - LEN(”{““out-0"”:”“”) - LEN(“”“}”))
Any idea on why the JSONata is not working on my JSON object?
btw I tried different types of columns including the single row and also different jsonata queries such as: [‘out-0’]
Many thanks!
Tim