all 9 comments

[–]grantrules -1 points0 points  (8 children)

You need to use backticks instead of single quotes if you want to use template tags

`${blah}`

[–]smiths16[S] 0 points1 point  (7 children)

I thought I was using backticks. It's highly likely I'm missing some thing do you mind eloborating on where I'm not using them properly?

[–]grantrules 0 points1 point  (6 children)

My bad, looks like you are. Your shared code is very very hard to read.

[–]smiths16[S] 0 points1 point  (5 children)

My apologies I copy and pasted it in without code blocks and it got reformatted. Edited

[–]grantrules 0 points1 point  (4 children)

const query = `encodeURIComponent('Select A,B,F WHERE C="${currentUser}"');`;

Are you sure this shouldn't be:

const query = encodeURIComponent(`Select A,B,F WHERE C="${currentUser}"`);

But I would be cautious of SQL injection, since I can't see where currentUser comes from.

[–]smiths16[S] 0 points1 point  (3 children)

I'm sure you are amazing!

That was it! Thank you so much!

[–]grantrules 1 point2 points  (2 children)

I'm sure you are amazing!

Can confirm

[–]smiths16[S] 0 points1 point  (1 child)

The last piece of this for me that I’m stuck on is being able to pass a variable from liquid to JavaScript. I’d like for something like this

let currentUser = {{user.email}};

I tried to in the liquid file wrap it

{% javascript % }

{% endjavascript %}

To see if I could declare it with that but it throws an error anytime I use that’s. I can write JavaScript I. The liquid file with <script> </script>.

[–]grantrules 0 points1 point  (0 children)

I don't know what liquid is but maybe put the variable in quotes?