Query

Forms Developer Guides Scripting Page Not Found Page Not Found Submissions

QUERY(conditions, options)

var conditions = [
  { field: "created", operator: ">", value: "yesterday" }
];

var options = {
  limit: 5
};

Form.new(permalink).submissions.query(conditions, options).then(function(submissions) {
  for (var i = 0; i < submissions.length; i++) {
    console.log(submissions[i].field("status"));
  }
});

Queries for submissions with the Query JSON condition and option format.

Return Value Notes

The value returned by the Promise is an array-like object, but isn't a real Array: it's a SubmissionDataArray. The individual submissions are also not real Submission objects, they are simpler SubmissionData objects.

Attributes like length and index-based access work for SubmissionDataArray objects (so for loops work), but for more advanced Array methods, you can use the all method to turn the value into an array.

The query methods return SubmissionData objects because they are optimized for large numbers of submissions. Normal Submission objects have overhead, so fewer could be loaded on average computers.

We recommend using the SubmissionData methods outlined in the documentation for reading or writing submission data, but if the user needs access to the record you can turn it into a Submission with the submission method. The method returns a promise which loads the submission.