I'm attempting make a form to insert a document into a firestore collection.
I'm working with a dropdown field that is a reference field in the collection.
when getting the data back the field contents looks like this.
{
"$ref": "companies/pOjUBNOX9lHAsVkA2OEQ"
}
I can get my display values just fine with this
{{ query6.data.map(d=>d.name) }}
however, I cannot seem to make it save into firestore as a reference field, it is saving as a string instead.
here is my dropdown values code
for anyone in the future that also has this issue....I heard back from support on Chat, and the solution was to parse the dropdown value in the query that saves the document (as opposed to doing it in the form element)
To recap - the js above are the field values in the dropdown of my form.
on submit, I will run a query to create a new document in firebase.
{{ JSON.parse(dropdown3.value) }}
here is what I had
It looks like your example does have a space between {{ JSON.parse(dropdown3.value) }} and the closing }, but I'm having trouble reproducing this error. If spacing is not the issue, feel free to reach out over chat. Happy to jump into your app to test