> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: updateSubmission(_id: string, submission: UpdateSubmission, options: UpdateSubmissionOptions) # Method package: wixFormsV2 # Method menu location: wixFormsV2 --> submissions --> updateSubmission # Method Link: https://dev.wix.com/docs/velo/apis/wix-forms-v2/submissions/update-submission.md # Method Description: Updates a submission. Each time the submission is updated, `revision` increments by 1. The existing `revision` must be included when updating the submission. This ensures you're working with the latest submission information, and prevents unintended overwrites. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Update a submission (dashboard page code) ```javascript import { submissions } from 'wix-forms.v2'; /* Sample _id value: "abb9b5c9-a881-467c-9c34-b9bea43ca5f0" Sample submission value: { "formId": "21bcb6c7-02b3-4ed1-b6db-7856094fac03", "seen": false, "status": "CONFIRMED", "revision": "6", "submissions": { "first_name": "Jane", "last_name": "McBride" } } */ export async function myUpdateSubmissionFunction(_id, submission) { try { const updatedSubmission = await submissions.updateSubmission(_id, submission); console.log('Success! Updated submission:', updatedSubmission); return updatedSubmission; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: { "formId": "21bcb6c7-02b3-4ed1-b6db-7856094fac03", "namespace": "wix.form_app.form", "status": "CONFIRMED", "submissions": { "last_name": "McBride", "first_name": "Jane" }, "revision": "6", "submitter": { "applicationId": "151e476a-715e-ec33-db9a-a7ff4d51f70a" }, "seen": false, "_id": "abb9b5c9-a881-467c-9c34-b9bea43ca5f0", "_createdDate": "2023-12-28T12:54:04.652Z", "_updatedDate": "2023-12-28T14:33:02.571Z" } */ ``` ## Update a submission (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { submissions } from 'wix-forms.v2'; import { elevate } from 'wix-auth'; /* Sample _id value: "abb9b5c9-a881-467c-9c34-b9bea43ca5f0" Sample submission value: { "formId": "21bcb6c7-02b3-4ed1-b6db-7856094fac03", "seen": false, "status": "CONFIRMED", "revision": "6", "submissions": { "first_name": "Jane", "last_name": "McBride" } } */ export const myUpdateSubmissionFunction = webMethod(Permissions.Anyone, async (_id, submission) => { try { const elevatedUpdateSubmission = elevate(submissions.updateSubmission); const updatedSubmission = await elevatedUpdateSubmission(_id, submission); console.log('Success! Updated submission:', updatedSubmission); return updatedSubmission; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to: { "formId": "21bcb6c7-02b3-4ed1-b6db-7856094fac03", "namespace": "wix.form_app.form", "status": "CONFIRMED", "submissions": { "last_name": "McBride", "first_name": "Jane" }, "revision": "6", "submitter": { "applicationId": "151e476a-715e-ec33-db9a-a7ff4d51f70a" }, "seen": false, "_id": "abb9b5c9-a881-467c-9c34-b9bea43ca5f0", "_createdDate": "2023-12-28T12:54:04.652Z", "_updatedDate": "2023-12-28T14:33:02.571Z" } */ ``` ---