so at the moment, I have this set up during the featureForm.on("submit") process. Everything seems to be okay, but then I receive an error message that reads error = l details: undefined message: "When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true" name: "feature-layer:invalid-parameter" [[Prototype]]: c
const blob = new Blob(document.getElementById("myForm1"), { type: "image/jpeg" })
const attachments = {
feature: editFeature,
attachment: {
globalId: editFeature.attributes.GlobalID,
data: blob
}
}
// Setup the applyEdits parameter with updates.
const edits = {
updateFeatures: [editFeature],
addAttachments: [attachments]
};
const options = {
// globalIdUsed has to be true when adding, updating or deleting attachments
globalIdUsed: true
};
console.log(edits);
applyEditsToIncidents(edits, options);
HTML form looks like this:
<form id="myForm1">
Please include a photo: <input type="file" name="attachment"/>
<input type="hidden" name="f" value="json">
</form>