Jump to content


Caspio Ninja
  • Posts

  • Joined

  • Last visited

  • Days Won


gsgriffin last won the day on September 5 2017

gsgriffin had the most liked content!

Recent Profile Visitors

597 profile views

gsgriffin's Achievements

  1. Is this really too big of an ask? I've seen posts linking to some code that is much more extensive and more than I need. If the API is this difficult that only professional coders can do it, perhaps the API need to be easier? Make the API so more can use it? Has nobody used the API to simply update fields in tables? I honestly thought this would be a just minute for someone to copy and paste without explanation. Hopefully some are still using this forum and I'm not the only one that would benefit from this.
  2. I've developed an application which would benefit by using the API, but the instructions given are not a great way for me to learn. Having instructions that say, "Just do this and then that" is missing the whole point of how and assuming those reading are professional programmers that do this all day for a living. Those of us who are self taught are left to do a lot of work trying to figure it out. I learn best by just seeing code and understanding what it is doing and then adapting to my needs. Wondering if anyone might be able to post a little code to help? All I need is an API code where I can send it the table, Row Id, field, and value and have that update in the table. I don't need Gets. I realize that doing all of this from Javascript is not a good idea with the with the client key being exposed (but OH, how that would make my life easier and faster). So, PHP on the server is my only other option, I suppose. I've already set up and have the account permissions. Could I ask that someone kindly just post an example PHP which would receive the needed values posted from the URL and do the action of updating a table field? My Javascript can post all the needed values in the URL call to the PHP. I can modify it from there to hide details a little better so it isn't obvious enough for someone else to simply make direct calls to the PHP. If I'm going about this the wrong way, feel free to offer a different solution, but some code example would really be helpful as opposed to telling me the better way. THANKS!!!!
  3. There was never a good solution to this, but I finally came up with this...in case someone else needs to run scripts making sure all cascading fields are loaded. I tend to have a default value in dropdowns and will always have at least one other option available. If you have cascading that may not have an additional value loaded, this may get stuck. RUN WITH jQUERY.... var notDone; function saveValue(){ notDone=false; $('select[name^="EditRecord"]').each(function(){ if($(this).children('option').length<2);//This count works so long as you have 2 or more options always notDone=true; }else{ var currentVal=$(this).val(); if(typeof $(this).val()!="undefined" && $(this).children('option[value="'+currentVal+'"]').length==0) { console.log("No option yet:"+currentVal); notDone=true; } } }); if(notDone){ console.log("Not done!!! waiting"); setTimeout(saveValue,500);//can decrease the time if you want it to check more frequently return false; } console.log("All options loaded"); ...........your waiting scripts here }
  4. I know this is very old, but it came up in a Google search for a topic similar to what I do. I submit forms all the time without leaving the page. I like to turn my Caspio forms into an instant storing off values as field change or after they stop typing for a textarea. In short, without going into extreme detail (which it would take and perhaps MayMusic understands this and can take the time), I do this: 1) create a hidden iFrame in the footer of the form 2) I use jQuery and when a field has changed (or after a delay of change for the textarea), I get the value and the field NAME that has changed. 3) With the value and fieldname, I create a URL for the iFrame that sends both the fieldname and the value to the very same form you already have loaded. 4) Scripts on the form look for the incoming fieldname and value. If it see those, it will change the current value for that field and then submit the form in the hidden frame. Do remember to hide the Submit button and don't use Caspio's default submit functions. You will also start an eternal loop of submissions to this hidden form unless you make a test. I end up first testing to see if the value of the field desiring an update matches the existing value or not. If it doesn't, then submit. If it matches the existing value, you may have submitted the form already. This is a little heavier in data and time. Large forms and slow internet can be a little more challenging, but all of my forms are now auto-submit to hidden forms as changes are made. Nobody complains. This is more common on the Internet today. People are used to it. Caspio should make it a feature.
  5. I have many cascading and non-cascading dropdowns in a form. I would like to execute a script once each and every dropdown is DONE loading. The script I was to attach to all types of dropdowns will be triggered by CHANGE. If I attach this before the cascading is complete, the new script will be executing each time a cascading option is added to the dropdown. I only want the new script to execute AFTER all OPTIONS for the dropdown have been loaded....cascading or not. As I test this, I have my script currently inside document.addEventListener('DataPageReady', function (event) { which should only execute after the page is ready. However, it appears to execute before all of the cascading fields have finished. I'm hoping that I don't have to attach a custom event listener for each and every dropdown but rather there is a way to have an evenlistener from Caspio that is when the page is REALLY ALL COMPLETELY DONE AND READY. Does this exist?
  6. I'd rather not. Just imagine a Caspio report datapage, which it is. There is no wireframe. Just a single report. It is not a problem to create the conditions for the report be matching a single value or greater than or less than an input value (or partial match on text). Typically, you have a single input value and the report gives us all results on that condition. I'm trying to get a result where I can pick and choose values....multiple matching in a single report on a single field. Perhaps this will help. Table ID whatever whatever whatever 1 asdfsdf asdfasdf asdasdf 2 asdfasdf asdfasdf asdfasdf 3 asdfsdaf asdfasdf asdfsdaf 4 asdfasdf asdfasdf asdfasdf 5 asdfsadf asdfasdf asdfasdf How can I get rows 1, 3 and 5, by matching the values of ID itself? There is no other way to match the rows. I'm trying to avoid combining the results of the report being run over and over for each instance to give me one result. ie. run report for ID=1 and then run report for ID=3, etc... then combine into a single page....yuck I was hoping I could create my list of ID to be something like "-1- -3- -5-" as my input matching string to the report. I then created a formula in the table so the last field in each row is the ID with hyphens before and after. So, row with ID of 3 also has a field at the end that is "-3-". I was hoping I could create the query match in the report to be finding -1- within the input string of "-1- -3- -5-" and with the match, return that row. Repeat for all.
  7. I hope I can explain this clearly. I have a value in a string like "-121- -245- -51- -111-" These could be changed and don't have to be in the format... I need to have a report that shows values from the rows in a table where those numbers are the autonumber assigned the row. So, I want the report to have 4 listed items, 121, 245,51,111 I've tried doing a formula to add "-121-" to each row in hopes that I could do "contains" for a match, but that is not an option. I know I could have all items come in the results and use JS to remove those I don't want. Worst would having to go through a relay page (php), to get the datapage, parse the values and then pass those on. This report must be in a iFrame for a page that does not reload. Basically, this is using values stored in cookies as favorites from the report pages and then want to give the ability to only show the items marked as favorite.
  8. Hunting and testing and trying. .. not finding....I would like to have a new submission form that goes to a "display message". That page needs to receive all of the posted values from the form in JS, but I would REALLY, REALLY like to avoid having to individually load each value using [@valuename]. I've been trying without success and don't know if these are passed or available or only loaded server side from Caspio, but my message being displayed is only going to be a relay to send values and load a separate datapage in a different iFrame. There is more post-processing that I need to do with those values. The reason for all of this is that I have a new submission form that I want to pass all the values to a separate datapage that is a report. The affect is to have a form for a report, but I'm storing each "report form" in a table as well. That way, we have a record of each report that was run. If there is a different way to go about this, I'm interested. Would really love to not have the entire page refresh with each question and can only think that the New Submission form going to a Response Message with javascript that reloads the same form and also send all values to the report datapage at the same time.
  9. For clarification....code should execute immediately after the page is completely done loading and all cascading fields have finished the initial loading. My case scenario is a page that receives an external value that is passed to a hidden virtual field. That hidden virtual field is the cascading dependency that many other cascading fields are waiting to change upon. They are all hidden, but provide the values I need for my script to act upon. I need to wait for all of the cascading fields to have completely loaded and then begin execution. There are a lot of variables in download speeds, that I have experienced, that can change the time it takes. It could be me, but the cascading fields don't always seem to update in order. Don't know if there are variables in connection speed or size of the request and database speed. Everything is always sequential? Especially when you have cascading drop-downs and different lengths and lots of them. I was hoping that there might be a Caspio event trigger that might be made available to tell us that there is no more loading of anything at the initial page load. I do realize that cascading can change and force a change to a field later, but the initial load, initial cascade completion is what I'm looking for. Your code is fine if there is a guaranteed change on load. If there is no cascading change, then it is not going to trigger.
  10. Not finding what I need. I need to wait for form datapage to finish loading all of the cascading text fields before running the script. I have a lot of cascading fields, so I cannot simply rely upon a trigger to fire onchange for the cascading field. Does Caspio have any event trigger that can confirm all loads are finished for all cascading fields? When loading, it should know how many fields are async getting information and it is waiting for a reply to update those fields. Would be great to have an event listener that can tell me ALL CASCADING FIELDS ARE DONE UPDATING. FYI...DataPageReady listener DOES NOT wait for cascading fields. It fires as soon as the initial HTML is loaded. Cascading is async and can be completed several seconds (or more) as the page is "fully loaded". Please do not suggest a timer to wait for a few seconds. That doesn't work well, is poor programming, doesn't take into consideration different processor, browser, and internet access speeds and can cause people to wait for 10 second for a page load....the worst! I believe this will have to be a Caspio event listener. Just can't find it in docs.
  11. Alison, This is not a problem with displaying a value. It is a challenge in trying to enter a default value in the saveable fields that will post to the table. Try this so you understand what I am asking: 1) Create a small table with a couple fields. Enter data, if you like. Make the first field in the table called, "AID" as an example. This is NOT a field to be generated automatically (autonumber). This is a number that will connect the relationship with a different table. 2) Create a datapage tabular report and make sure it is given the ability to GRID EDIT and the ability to INLINE EDIT and ADD RECORDS. Run the report and enter grid edit mode. Now, what I need, is to pass along an external value for the AID in the filter for the report results. No problem, Easy. Now, in the display, all of the rows will only show for rows with matching AID. I want everything new entered while looking at the report should also always have the same AID. That is fine on the inline edit mode. I've scripted for that. It can make sure the AID cell is automatically populated with an insert. I can also script for that to ensure it stays the same AID. Now, enter GRID EDIT mode while looking at the report. Looking at the source code, when you enter a row or leave a row, the DOM is dynamically modified, hidden cells are created and taken away, and I'm assuming AJAX is submitted the data for each cell after you leave it (internal API?). So, in Grid Edit mode, I'm wondering if there is already a function that Caspio provides that would allow for a row to have a fixed value for a field in the table. It could be hidden (actually best if it is). The user doesn't know the AID and doesn't need to even see it, but I don't know and can't easily tell if there is a way to force that value WHILE IN GRID EDIT MODE. The Grid Edit is a nice tool for the end user, but since I can supply the table relationship connecting value for them automatically, I can't use grid edit and have to use the clunky standard report with edit, delete and empty fields for adding.
  12. I really appreciate and can typically quickly figure out how to use a tool or function based on an example. A few seconds studying an example is worth far more than a thousand words trying to describe it. I've been looking and not finding, but perhaps not searching for the right term? Where are there examples of using the REST or SOAP API in JAVASCRIPT for sending data to or getting data from the table? I would really like to use this, but the descriptions in the help don't get to the actual script examples. Spending a lot of time in trial and error trying to get it to work. Prefer Jquery, if this is easier.
  13. The desire is to have one of the editable cells (a cell that is storing a value in the table upon edit of the row) have a default value. When you add a new row, none of the cells that are editable can have a default value. I've figured out pretty easily how to do this when NOT in Grid Edit, but in Grid Edit mode, there is a dynamic change to each row when entered and then a storing of the values that appears to be AJAX. I need to be able to have a default cell value that is stored to the table when a new row is being edited or created.
  14. I would like to have Grid Edit by default view with a default value in one cell for each row added (and not user editable). Each row edited and added to the Grid Edit needs to have this common value for the table relationship. Before I waste a lot of time trying to reverse engineer what they are doing dynamically when each row is being edited, would be nice to know if there is already a known way to do this. Grid Edit is a great feature, but to not be able to enter a default value in either the configuration or the actual fields really reduces this overall functionality and forces the user to enter all values, unless I am missing something....like posting the value from the placeholder. This is easy to do when NOT in Grid Edit, but the dynamic nature of taking a value and setting it somewhere hidden This is not a display challenge. The default value needs to be for a field in the row that is to be saved with the row....the editable cells, not a viewing cell with a calculated value, unless the calculation can be saved in a field for the table when the row is edited.
  • Create New...