ContributionsMost RecentMost LikesSolutionsRe: Created A,B and C gruop of 10 records Thank you for your follow-up. I find that part of the issue is fields used on the query are lookup field formulas. ------------------------------ Data System Analyst (Administrator) ------------------------------ Re: Created A,B and C gruop of 10 records Hi Mark yes, ten records per group if they are on the same level the ranking part of the formula was just a test if I place back your original ranking distribution, yes placement ID original was {Record ID#]. Fields 344 and 362 are formula fields that combine lookup view field types. So, I duplicated both fields to pretend there were data user input fields, so when I made those changes, your formula performed flawlessly ( 10 records per group and same level). Did you know if formula query cannot be used with formulas that use a lookup view field? Or did you know how to use lookup view fields in formula queries? ------------------------------ Data System Analyst (Administrator) ------------------------------ Re: Created A,B and C gruop of 10 records Hi Mark, no worries, var text QUERY = "{362.EX.'" & [Testing ESL Level] & "'}" & "AND"& "{3.LTE.'" & [Placement ID] & "'}" & "AND"& "{344.CT.'" & "ESL" & "'}" ; var number Ranking =Size(GetRecords($QUERY)); If( $Ranking <=1000, "A", $Ranking <=1020, "B", $Ranking <=1030, "C", $Ranking <=1040, "D", $Ranking <=1050, "E", $Ranking <=1060, "F", $Ranking <=1070, "G", $Ranking <=1080, "H", $Ranking <=1090, "I", $Ranking <=1000, "J", $Ranking <=2010, "J", $Ranking <=2020, "L", $Ranking <=2030, "M", $Ranking <=2040, "N", $Ranking <=2050, "O", $Ranking <=2060, "P", $Ranking <=2070, "Q", $Ranking <=2080, "R", $Ranking <=2090, "S", $Ranking <=19000, "T", "Z" ) The placement record ID is nos 10, 11, 12, 14..., and so on; when I re-write (trying out) 1000 and 1020...., I got 3 groups with different amounts of records for each group. The idea is that each group has a max of 10 records. I hope this makes sense. Thank you again. ------------------------------ Data System Analyst (Administrator) ------------------------------ Re: Created A,B and C gruop of 10 records Hello. Thank you for the suggestion; I haven't been able to find the solutions, even with your help. I will keep digging to find a solution. Thank you both. ------------------------------ Data System Analyst (Administrator) ------------------------------ Re: Created A,B and C gruop of 10 records HI Mike.this is awsome I made all modifications but placed all records with the letter "A" the max of records per letter needs to be 10 max var text QUERY = "{344.CT.'" & "ESL" & "'}" & "{362.EX.'" & [Testing ESL Level] & "'}" & "{3.LTE.'" & [Placement ID] & "'}"; var number Ranking =Size(GetRecords($QUERY)); If( $Ranking <=10, "A", $Ranking <=20, "B", $Ranking <=30, "C","Z" ) ------------------------------ Data System Analyst (Administrator) ------------------------------ Re: Created A,B and C gruop of 10 records Hi Mark, I knew that you would have some guidance for it. Nevertheless, looking forward to seeing the formulas. thank you for your help on this. ------------------------------ Data System Analyst (Administrator) ------------------------------ Re: Created A,B and C gruop of 10 records Hi Mark (Happy Holidays) Yes. For example, I said that I have 100 records. I need to create groups of 10 records, so let's. I am saying that I have 50 records set at level one (1) and 50 defined at level two (2), so the formula I am looking to create will set a letter for each group. GED-Level 1-A; GED-Level 1-B; GED-Level 1-C..... GED-Level 2-A; GED-Level 2-B; GED-Level 2-C..... I should end with 5 grups (A,B,C,D,E) for Level 1 and 5 grups (A,B,C,D,E) for Level 2 Plus, if more records are created, the number of groups increases. Fields Level record id program (GED) I hope makes sense. 100/10 will end with 10 groups that each grup will have a letter that represents it. ------------------------------ Data System Analyst (Administrator) ------------------------------ Created A,B and C gruop of 10 records Hello all I need help does anybody know a formula for creating a group of 10 records and labeling those records as A, B etch based on levels 1, 2, 3, etc? Level 1, max 10 records = "A" level 1 Max 10 records = B, etc etc ------------------------------ Data System Analyst (Administrator) ------------------------------ Re: Redirect code page that show the new recordHello thank you. when it redirects to the HTML page, I look for the new record to be reflected there. Also thanks for the info. very if from there I can find the solution. ------------------------------ Data System Analyst (Administrator) ------------------------------ Redirect code page that show the new recordHello. I have a button to add a new record and then redirect to a code page. I am trying to show the new record on the code page return(Page id 179) . much appreciated the support on my code page that I am not sure what I'm missing to show the record after redirect. url field var text urlToExecute = URLRoot() & "db/" & Dbid() & "?a=API_AddRecord" & "&_fid_11=" // Field to Popuplate with the user prompted input ; var text redirect = URLRoot() & "db/" & AppID() & "?a=dbpage&pageid=179" // Open code page 4 & "&url="& URLEncode($urlToExecute) // Pass in the URL to execute PAGE ID 179 <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="UTF-8"> <title>School Meals Track System</title> <script src= 'https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script> <link rel='stylesheet' href= 'https://www.w3schools.com/w3css/4/w3.css'> <link rel='stylesheet' href= 'https://fonts.googleapis.com/css?family=Raleway'> <link rel='stylesheet' href= 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'> <style> body,h1,h2,h3,h4,h5,h6 {font-family: 'Raleway', sans-serif} body, html { height: 100%; line-height: 1.8; } /* Full height image header */ .bgimg-1 { background-position: center; background-size: cover; background-image: url(' https://nextsteppcs.quickbase.com/up/bpc9zk5b6/g/rd3g/eh/va/blackboard-books-apple-school-nutrition.jpg'); min-height: 100%; </style> </head> <body> <p></p> <h1 class='bgimg-1 w3-display-container w3-grayscale-min' id='home'> <div class='w3-display-left w3-text-white' style='padding:48px'> <h1>School Meals Track System</h1> <span class='w3-jumbo w3-hide-small'>Hello TNS Student <span id='myDIV'></span>!</span><br><br> </style> </head> <style> .loader { border: 16px solid #f3f3f3; border-radius: 50%; border-top: 16px solid #3498db; width: 120px; height: 120px; -webkit-animation: spin 2s linear infinite; /* Safari */ animation: spin 2s linear infinite; display: block; margin-left: auto; margin-right: auto; } /* Safari */ @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } </style> <body> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> <script src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js'> </script> <script> function run() { $('#form').hide(); $('#status').show(); const input = document.getElementById('input').value; let urlParams = new URLSearchParams(window.location.search); let url = urlParams.get('url') + encodeURIComponent(input); let redirect = urlParams.get('redirect'); let landing; console.log("input" + input); console.log("redirect" + redirect);; console.log("document.referrer" + document.referrer); console.log("window.location.href " + window.location.href ) console.log("URL" + url) if(redirect){ landing = redirect; }else{ landing = document.referrer; } fetch(url, { method: 'post', mode: 'no-cors', headers: { 'Content-type': 'text/plain' }, }) .then((response) => { console.log("RESPONSESTATUS " + response.status); console.log("RESPONSE STATUSTEXT" + response.text()); console.log("RESPONSEredirected " +response.redirected); console.log("RESPONSEheaders" +response.headers); console.log("RESPONSEbody" + response.body); console.log("landing " + landing); rdr(); }).catch(err => { console.log('Request Failed', err); rdrfail(); }); } function xmlrun(){ const input = document.getElementById('input').value; let urlParams = new URLSearchParams(window.location.search); let url = urlParams.get('url') + encodeURIComponent(input); console.log(url) let xhr = new XMLHttpRequest(); xhr.open('POST', url); xhr.setRequestHeader('Content-Type', 'text/plain' ); xhr.send(); xhr.onload = function() { if (xhr.status != 200) { // analyze HTTP status of the response alert(`Error ${xhr.status}: ${xhr.statusText}`); // e.g. 404: Not Found } else { // show the result console.log('Done, got ${xhr.response.length} bytes'); // response is the server response } }; xhr.onprogress = function(event) { if (event.lengthComputable) { //alert(`Received ${event.loaded} of ${event.total} bytes`); console.log('Received ${event.loaded} of ${event.total} bytes'); } else { //alert(`Received ${event.loaded} bytes`); // no Content-Length console.log('Received ${event.loaded} of ${event.total} bytes'); }; rdr() }; xhr.onerror = function() { alert("Request failed"); }; } function rdr(){ console.log("Success redirecting to " + window.location.href ); window.location.href = window.location.href ; } function rdrfail(){ console.log("Fail redirecting to " + window.location.href ); window.location.href = window.location.href ; } function status(res) { if (!res.ok) { throw new Error(res.statusText); } return res; } </script> <div class="container" id="form"> <h2></h2> <form onSubmit="xmlrun();return false"> <div class="form-group"> <label for="input">Please scan the student id</label> <input class="form-control" id="input" autofocus> </div> </form> </div> <div class="container" id="status" style="text-align:center" hidden> <h2>Making API Calls, will redirect once complete.</h2> <div class="loader" id="loader"></div></div> <br> </body> </html> <!-- <form onSubmit="run();"> ------------------------------ Data System Analyst (Administrator) ------------------------------