- Goal: To update entries as an array instead of string
currently, i have a form that sends form.data to firebase, which stores partsFixed as an array.
when i wish to update my form entry, all works properly except when i try to update partsFixed, as a modification in parts leads to the whole data being treated like a string. this is what my update code looks like
{"recordBy": "{{ UpdateUserForm1.data.editRecordBy}}",
"partsFixed": "{{tranformPartsFixed.value}}",
"contractorName":"{{ UpdateUserForm1.data.contractorName2}}",
"defectsDetails": "{{ UpdateUserForm1.data.remarks2}}",
"correctiveAction":"{{ UpdateUserForm1.data.correctiveAction2}}",
"sparesRequired":"{{ UpdateUserForm1.data.sparesRequired2}}",
"completed":"{{ UpdateUserForm1.data.completed2}}",
"dateTimeComplete":"{{ UpdateUserForm1.data.dateTimeComplete2}}"
}
transformpartsFixed returns an array, but yet the object returned when updating somehow converts it back to a string
after updating
After creating form
this is my transformPartsFixed
const data= {{ UpdateUserForm1.data.partsFixed2 }}
const output= [data]
return output