Search...
deleteSubmission( )
Deletes a submission.
Note: The Submissions API is only available in Wix Studio and Editor X.
Description
This function moves the form submission into the trash bin. To delete the submission permanently, change the default permanent
field value to true.
Admin Method
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function deleteSubmission(submissionId: string, options: DeleteSubmissionOptions): Promise<void>
deleteSubmission Parameters
NAME
TYPE
DESCRIPTION
submissionId
string
ID of the submission to delete.
options
Optional
DeleteSubmissionOptions
Optional fields.
Returns
Return Type:
Promise<
void
>Was this helpful?
Delete a submission (dashboard page code)
Copy Code
1import { submissions } from 'wix-forms.v2';23/*4Sample submissionId value: "f8281b62-1b2f-45bf-ba7d-f041d7653d2d"5*/67export async function myDeleteSubmissionFunction(submissionId) {8 try {9 const deletedSubmission = await submissions.deleteSubmission(submissionId);10 console.log('Success! Submission is deleted');11 return deletedSubmission;12 } catch (error) {13 console.error(error);14 // Handle the error15 }16}1718/* Promise resolves to void */
Delete a submission (export from backend code)
Copy Code
1import { Permissions, webMethod } from 'wix-web-module';2import { submissions } from 'wix-forms.v2';3import { elevate } from 'wix-auth';45/*6Sample submissionId value: "f8281b62-1b2f-45bf-ba7d-f041d7653d2d"7*/89export const myDeleteSubmissionFunction = webMethod(Permissions.Anyone, async (submissionId) => {10 try {11 const elevatedDeleteSubmission = elevate(submissions.deleteSubmission);12 const deletedSubmission = await elevatedDeleteSubmission(submissionId);13 console.log('Success! Submission is deleted');14 return deletedSubmission;15 } catch (error) {16 console.error(error);17 // Handle the error18 }19});2021/* Promise resolves to void */22