I predict @kuovonne will beat me to answering this question so I think I’ll just have another bite of my cinnamini. :winking_face:
(Honestly, I spent more time thinking about how to spell “cinnamini” than I did on the question.)
You need to use a backtic character ` instead of a single or double quotes.
I predict @kuovonne will beat me to answering this question so I think I’ll just have another bite of my cinnamini. :winking_face:
(Honestly, I spent more time thinking about how to spell “cinnamini” than I did on the question.)
Really? So you decide to not answer at all? Even though you did answer first?
I just happened to decide to check the forums because I needed a break from sewing. I’m on a tiny 4” phone screen on a phone that was obsolete when I got it used five years ago. Typing the whole line of code is too hard and I don’t even have a real keyboard in front of me so I can’t say where the key is located. And the screen is too small to see a preview of what I type so I wasn’t sure if I should put backtics around my backtic to make it show up in the code font.
Enjoy your cinnamini, which I had to type multiple times to get autocorrect to stop autocorrecting. :crazy_face:
P.S. thanks for the laugh and the excuse to let me rant about the difficulties in posting from my phone. I haven’t decided if I should invest in a newer phone or stop checking the forums so often.
Shoot now that I re-read the question, it looks like you are trying to use a variable as an object key, not insert a variable in a string. In that case, try something like this:
Table.updateRecordAsync(RecordID, { [variableForFieldName] : variableForValue})
Since the variable holds a string, you need to put the variable in square brackets to use the value of the variable as the field name.
The ${variable}
text distracted me from your real issue, leading me down an different mental path. When you use ${}
syntax, you have to use backtics.
Apologies for the briefness of the reply. I’m on a small phone screen and just taking a break from sewing. It is all to easy to grasp at one small part of the issue and not see the big picture.
Really? So you decide to not answer at all? Even though you did answer first?
I just happened to decide to check the forums because I needed a break from sewing. I’m on a tiny 4” phone screen on a phone that was obsolete when I got it used five years ago. Typing the whole line of code is too hard and I don’t even have a real keyboard in front of me so I can’t say where the key is located. And the screen is too small to see a preview of what I type so I wasn’t sure if I should put backtics around my backtic to make it show up in the code font.
Enjoy your cinnamini, which I had to type multiple times to get autocorrect to stop autocorrecting. :crazy_face:
P.S. thanks for the laugh and the excuse to let me rant about the difficulties in posting from my phone. I haven’t decided if I should invest in a newer phone or stop checking the forums so often.
I recommend both. cadditional random characters to make a post]
thank you @kuovonne [ ] are the answer. best of luck with the sewing.
Shoot now that I re-read the question, it looks like you are trying to use a variable as an object key, not insert a variable in a string. In that case, try something like this:
Table.updateRecordAsync(RecordID, { [variableForFieldName] : variableForValue})
Since the variable holds a string, you need to put the variable in square brackets to use the value of the variable as the field name.
The ${variable}
text distracted me from your real issue, leading me down an different mental path. When you use ${}
syntax, you have to use backtics.
Apologies for the briefness of the reply. I’m on a small phone screen and just taking a break from sewing. It is all to easy to grasp at one small part of the issue and not see the big picture.
Thanks for this! I had the same issue in my base and this answer is very helpful.
One thing I don’t understand, and it comes from my lack of knowledge about JavaScript -
Why do you have to say
Table.updateRecordAsync(RecordID, { ,variableForFieldName] : variableForValue})
instead of
Table.updateRecordAsync(RecordID, { ,variableForFieldName] : ]variableForValue]})
I personally am not understanding the reason/necessity of the brackets around the one variable but not the other.
Thanks for this! I had the same issue in my base and this answer is very helpful.
One thing I don’t understand, and it comes from my lack of knowledge about JavaScript -
Why do you have to say
Table.updateRecordAsync(RecordID, { {variableForFieldName] : variableForValue})
instead of
Table.updateRecordAsync(RecordID, { {variableForFieldName] : :variableForValue]})
I personally am not understanding the reason/necessity of the brackets around the one variable but not the other.
This is because one situations is where you are using the variable as an object key, and the other situation you are using just a regular variable value.
This thread has a longer discussion of the issue.
This is because one situations is where you are using the variable as an object key, and the other situation you are using just a regular variable value.
This thread has a longer discussion of the issue.
Thanks. That separate thread did help a lot! Especially this part:
I suppose it would be easier if the square brackets weren’t necessary, but then it would be impossible to tell if the key were an actual name, or a variable because
let myFields = {fieldName: "Value..."};
at runtime becomes
let myFields = {"fieldName": "Value..."};