Submission Management

Scripting Custom Scripts

The SubmissionManager object handles bulk control of submissions belonging to a Form. It can be accessed from custom scripts with submission.form.submissions.

all()

This method is available to server-side scripts.

Returns an array of all submissions belonging to the Form.

submission.form.submissions.all()

count()

Fetches the current number of submissions to the form from the server, if the user has READ permission for the form. Returns a Deferred object.

submission.form.submissions.count().done(function(number) {
  console.log("There have been " + number + " submissions to this form.");
});

find(permalink)

Query a submission from the server by permalink. For more advanced querying, see Querying. This method is currently unavailable from server-side scripts, but will be added soon. Querying for submissions directly is available server-side.

submission.form.submissions.find("ABCDEFGHIJ")

find_locally(permalink)

Finds an initialized submission object by permalink. This will not fetch submission data from the server, only look up already-loaded submissions. To query submissions from the server, see find.

submission.form.submissions.find_locally("ABCDEFGHIJ")

find_new()

Returns an initialized but unsaved submission, if one is present. Unsaved submissions do not have permalinks.

submission.form.submissions.find_new()

first()

This method is available to server-side scripts.

Returns the first submission object belonging to the form.

submission.form.submissions.first()

last()

This method is available to server-side scripts.

Returns the last submission object belonging to the form.

submission.form.submissions.last()

load(permalink = undefined)

Fetches a submission from the server by permalink in the background, with no modal initially visible to the user. The submission can be made visible with the modal.show() property on the returned object. This method returns a jQuery Deferred object, which resolves with a Submission object. If no permalink is given, an empty unsaved submission is loaded.

submission.form.submissions.load("ABCDEFGHIJ").done(function(new_submission) {
  // Make the submission visible
  new_submission.modal.show()

  console.log("submission " + new_submission.permalink() + " loaded.")
});

open(permalink = undefined)

Fetches a submission from the server by permalink, and opens the submission's modal when it loads. This method returns a jQuery Deferred object, which resolves with a Submission object. If no permalink is given, an empty unsaved submission is loaded and opened.

submission.form.submissions.open("ABCDEFGHIJ").done(function(new_submission) {
  console.log("submission " + new_submission.permalink() + " loaded.")
});

open_new()

Shows an initialized new submission if one exists, otherwise loads one from the server. For example, this allows the user to click "New Response", exit the modal, and click it again to resume their work on the same submission.

submission.form.submissions.open_new().done(function(new_submission) {
  console.log("submission " + new_submission.permalink() + " loaded.")
})

remove(permalink)

Remove an initialized submission by permalink. This will not delete the submission from the database, but only uninitialize it locally. Returns a boolean value indicating whether the removal was successful or not.

submission.form.submissions.remove("ABCDEFGHIJ")

second()

This method is available to server-side scripts.

Returns the second submission object belonging to the form.

submission.form.submissions.second()

third()

This method is available to server-side scripts.

Returns the third submission object belonging to the form.

submission.form.submissions.third()