pravaah Posted April 25 Report Share Posted April 25 In my table there was 100 record but it had some status like "Pending", "Approved" and "Selected". So autonumber will not work for me to select the record according to the status. In the datapage i am filtering record with status "Selected" and in that record i want to show number of record that entered by the user. Like if user want 5 record so he/she able to view only 5. If 10 then able to view 10 records with same status "Selected" Quote Link to comment Share on other sites More sharing options...
Barry Posted April 29 Report Share Posted April 29 Hello pravaah. If you want to count the number of records you can use a Calculated field formula with the "COUNT" function. It is also possible to use authentication fields in the WHERE to filter, https://howto.caspio.com/parameters/parameter-types/#:~:text=Authentication Fields SELECT COUNT(unique_id) FROM table WHERE fieldNameFromTable = target.[@field:fieldFromRow] If you want to filter the results based on the authenticated user, then you can use the record level security feature: https://howto.caspio.com/authentications-and-connections/authentication/record-level-security/restrict-access-to-data-by-user-or-role/#:~:text=Restrict record access based on user identity Quote Link to comment Share on other sites More sharing options...
pravaah Posted May 16 Author Report Share Posted May 16 Hi Barry this use to count the number of records into the table with some condition. But i want to select dynamic number of record form the table. Which was inputted by the user. And the output will change the status. And that selected record not visible to another user with same access. Quote Link to comment Share on other sites More sharing options...
pravaah Posted May 29 Author Report Share Posted May 29 Hi All, I had created one solution for that. 1. create a virtual field to search the Number of Record that you want to show to the user. <script type="text/javascript"> document.querySelector("#cbParamVirtual1").type="number"; </script> ### this will help to enter only number into the filed. 2. Now pass the value to the table view. <script type="text/javascript"> let isFlag = true; document.addEventListener("DataPageReady", function (event) { if (isFlag) { let valueGetting = document.getElementsByName( "VirtualParam_cbParamVirtual1" )[0]?.value; let newOption = document.createElement("option"); newOption.text = valueGetting; newOption.value = valueGetting; let selectElement = document.getElementsByClassName( "cbResultSetRecordPerPageControl" )[0]; selectElement.appendChild(newOption); newOption.selected = true; selectElement.onchange(); isFlag = false; } }); </script> ### with some style to hide the footer of the table. <style> .cbNavBarCtnt{ display:none !important; } .cbResultSetRecordMessage{ display:none !important; } </style> 3.I am also updateing the selected record after selection i will refresh the page so user can enter record again. <script type="text/javascript"> const actionButton = document.querySelector(".ActionButton"); actionButton.addEventListener("click", function() { window.location= "your url link? For redirection"; }); </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.