I am trying to display a table in a Survey 123 form showing the last three values collected for questions on the form. I'm using a version based on Ishmael's examples at https://github.com/IsmaelInRedlands/Survey123-Tricks-of-the-Trade/blob/main/getLastSubmittedRecord.js. I have gotten to the point of displaying the Json return in a null notes field, but it only displays the first record. The max record return for the service is the standard 2000. I have tried asking explicitly for a set number or leaving the &resultRecordCount= parameter out. Any thoughts on why only one record is returned?
The calculation is
pulldata("@javascript", "getRecord.js", "getRecords", ${qry_related_records}, "Voltage_Drop_Across_Shunt,Surveyor,Survey_Date", pulldata("@property","token"))
the query is
Parent_Test_Station_GUID='{4C1BF90A-2136-4905-B1E9-9DA0F39490EA}'
the script is
function getRecords(qry, fields, token){ var featureLayer = "https://services7.arcgis.com/#####/arcgis/rest/services/ServiceName/FeatureServer/0"; var xmlhttp = new XMLHttpRequest(); var url = featureLayer + "/query?outFields=" + fields + "&orderByFields=OBJECTID+DESC&f=json"; // &resultRecordCount=3 var url = url + "&where=" + qry if (token){ url = url + "&token=" + token; } else { return "You must be logged in"; } xmlhttp.open("GET",url,false); xmlhttp.send(); if (xmlhttp.status!==200){ return (xmlhttp.status); } else { var responseJSON=JSON.parse(xmlhttp.responseText) if (responseJSON.error){ return (JSON.stringify(responseJSON.error)); } else { if (responseJSON.features[0]){ return JSON.stringify(responseJSON.features); } else{ return "Never submitted before"; } } }}
it returns

Thrilled to get the most recent record based on the descending sort on object id, but really would like all three records I know exist.
My next step will be converting the Json to an html table for display).