To fetch all the records in a form, specify the criteria as [ID != 0], where ID is a auto-generated field that contains a unique value for each record in the form.
Example:
rec = Contact [ID != 0] sort by Added_Time range from 1 to 5;
where,
rec it is the name of the collection variable that contains form data.
Contact name of the form whose data has to be fetched.
[ID !=0] is the criteria expression.
sort by Added_Time - the field based on which the records will be sorted. Here, Added_Time is the Deluge variable, which returns the time when the record was added.
range from 1 to 5 - range enables you to limit the records fetched within the start index (x) and end index (y). If range is not specified, all the records in the form that satisfy the given criteria, will be fetched.