Retrieves a submission by ID.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function getSubmission(submissionId: string): Promise<GetSubmissionResponse>;
ID of the submission to retrieve.
import { submissions } from "wix-forms.v2";
/*
Sample submissionId value: "abb9b5c9-a881-467c-9c34-b9bea43ca5f0"
*/
export async function myGetSubmissionFunction(submissionId) {
try {
const submission = await submissions.getSubmission(submissionId);
console.log("Success! Submission:", submission);
return submission;
} 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": "Doe",
"first_name": "John"
},
"revision": "4",
"submitter": {
"applicationId": "151e476a-715e-ec33-db9a-a7ff4d51f70a"
},
"seen": true,
"_id": "abb9b5c9-a881-467c-9c34-b9bea43ca5f0",
"_createdDate": "2023-12-28T12:54:04.652Z",
"_updatedDate": "2023-12-28T13:42:24.856Z"
}
*/
import { submissions } from "wix-forms.v2";
/*
Sample submissionId value: "abb9b5c9-a881-467c-9c34-b9bea43ca5f0"
*/
export async function myGetSubmissionFunction(submissionId) {
try {
const submission = await submissions.getSubmission(submissionId);
console.log("Success! Submission:", submission);
return submission;
} 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": "Doe",
"first_name": "John"
},
"revision": "4",
"submitter": {
"applicationId": "151e476a-715e-ec33-db9a-a7ff4d51f70a"
},
"seen": true,
"_id": "abb9b5c9-a881-467c-9c34-b9bea43ca5f0",
"_createdDate": "2023-12-28T12:54:04.652Z",
"_updatedDate": "2023-12-28T13:42:24.856Z"
}
*/