Hello! Firstly, I'm a materials engineer, not a programmer, but I'm learning my way through Retool so that I can build some apps for data collection in the lab. One such app is so techs can fill out a form and copy mass spectroscopy data into a cell, then submit this data to a database; right now I'm just trying to submit data to a table that acts as the database, until I transfer it to our intranet.
I've created this transformer to import the MS data:
and while it will add a row, it won't import the MS data, but I'm not getting an error regarding the transformer, primarily the 'addRow' query, having to do with assignment, but there is assignment!!
When adding a new row that should be empty, do I need to refer to anything? My original thinking was that it should be prepared to receive a numerical value.
Yes* but I've made the suggested adjustments and am now encountering an issue when adding a row. I'm getting an error that says, "invalid input syntax for type double precision: ""," which a quick search suggests I'm trying to push more data than there are columns for? I've doublechecked at least that isn't the issue.
BUT I am having an issue with the updateRow query. I get a "syntax error at or near "="" thrown; is there a way to identify which, assuming the first? Is that the incorrect syntax for identifying the column value from a form?
Looking at the latest screenshots, I'd suggest more specific JS objects, for example in the {{form_textArea}} I would typically use a {{text.value}} to add into my key:value pairs.
This looks a bit off with all of these key:value pairs, and again when referencing select1 and select2, those objects are typically too general for this purpose and won't be SQL compatible.
Possibly try drilling down into more specific js objects to ensure you are exposing compatible strings for your UPDATE?
From the screenshot, I would say yes - but it's a little bit difficult to tell exactly what your SQL Mode query looks like.....I would say you should specify the value - it seems as tho you are referencing the component text area which is assigned a Key, but what we really want are the value(s) in the new Row - at least that's what seems logical since it is a form.
For example, in your - in your new Row you want to add the values of the text input to "Initial Time", "Procedure", "Comments", etc. If I were to set this up, I would assign each text field or value input.value to the appropriate KEY:VALUE pair.
key = procedure : value = {{formText3.value}}
key = comments: value = {{formText4.value}}