Query JSON - quotation marks

How do I get the query JSON column to return a string value without quotation marks using JSONata?

1 Like

I think I know what you mean …

are your annoying quotation marks at the beginning and end of the received JSON data, right?

I suffered this yesterday :woozy_face:

Can you show some screenshots to verify if my workaround is useful for you?

Saludos!

1 Like

We talked to @BrettH about this yesterday. If I hear something from him, I’ll let you know.

2 Likes
{"id":"string","resource":"payment","mode":"test","amount":{"value":"600.00","currency":"QAR"},"description":"Jamm Factory :: Monday - 14:00 :: Drummer","method":"creditcard","redirectUrl":"URLstring","webhookUrl":null,"status":"open","organizationId":"string","sequenceType":"oneoff","metadata":{},"createdAt":"2023-08-24T21:34:43.001Z","expiresAt":"2023-08-24T21:49:42.990Z","_links":{"self":{"href":"URLstring","type":"application/hal+json"},"checkout":{"href":"URLstring","type":"text/html"},"dashboard":{"href":"URLstring","type":"text/html"}}}

I need $._links.checkout.href but it is returning “URLstring”. I can remove them with an additional template column, but it’s not really a solution with bigger objects with many multiple values needing to be extracted.

2 Likes

Not sure what to do for this! If this is a bug glide team will fix it! In the meantime for one column solution you can use the JavaScript column!

image

JS Code :

const jsonData = JSON.parse(p1);
const checkoutHref = jsonData._links.checkout.href;
return checkoutHref;

Thank you

I don’t think it’s a bug, I think it’s default JSONata behaviour. There is probably a simple way to force JSONata to return an unquoted string, but I’ve been searching the docs and haven’t found it yet :man_shrugging:

I’ll be watching this thread to see if somebody provides a simple answer.

2 Likes

This is so strange, I have this setup on one of my projects and it was working fine without the quotes, now it’s suddenly including the quotes.

Is there a way to extract the text within the quotes? I’ve tried using ‘Extract Matching Text’ but haven’t had any luck.

Yes, my experience was similar, I could have sworn on the first day the quotation marks didn’t appear.

The easiest solution I found for my purposes was to use a template column and replace " with nothing.

Obviously a terrible hack and only worked for me because the string itself didn’t contain that character. I’m not quite savvy enough to implement to JavaScript solution above.

I’m hoping a solution will appear that doesn’t require additional columns :pray::crossed_fingers:

1 Like

I can confirm this. Not sure what changed on their side.

yes I think something was changed from some JSONata library

I used to receive the data like:

Aug 18, 2023, 10:13:31 PM|#83a7b|Olguita|555000|0412-555000|olga@dsados.com|Qta Olga, maracay edo. aragua|- (1) RISOTTO ALL’ARAGOSTA: US$9.60|US$9.6|N/A|

but now I have the same data wrapped in quotes :woozy_face:

" Aug 18, 2023, 10:13:31 PM|#83a7b|Olguita|555000|0412-555000|olga@dsados.com|Qta Olga, maracay edo. aragua|- (1) RISOTTO ALL’ARAGOSTA: US$9.60|US$9.6|N/A|"

My workaround to remove these quotes (at the beginning and at the end) was using a JS code (@Adam_Crossley):

image

let lon= p1.length
return p1.substring(1, lon-1)

I hope it helps meanwhile

Saludos!

2 Likes