Jump to content

douvega

Caspio Guru
  • Posts

    129
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by douvega

  1. Hi everyone, I use this script which works fine for me. I hope it works for you too! Add this HTML to your webpage: <style type="text/css"> #loader{ width: 100%; height: 100%; position: fixed; z-index: 99999; background: #FFF; } .loader { border: 12px solid #f3f3f3; border-radius: 50%; border-top: 12px solid #444444; width: 70px; height: 70px; animation: spin 1s linear infinite; } .center { position: fixed; top: 0; bottom: 0; left: 0; right: 0; margin: auto; } @keyframes spin { 100% { transform: rotate(360deg); } } </style> <div id="loader" style="display: none;"> <div class="loader center"></div> </div> <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function(event) { //always display the loader when button is clicked document.querySelector('#loader').style.display = 'block'; }); document.addEventListener('FormSubmitted', function(event) { //hide the loader when form is submitted document.querySelector('#loader').style.display = 'none'; //get the Caspio Dapatage unique element ID var elementID = event.detail.UniqueSuffix; //datapage error element var errorMsg = document.querySelector("div#cbDataAjaxCtnr" + elementID + " [data-cb-name='HeaderErrorMsg']"); //datapage success element in case you have set to display a message after form submission var successMsg = document.querySelector("div.cbConfirmationMessages#PostBackMessage" + elementID); if(errorMsg){ //IF THE ERROR ELEMENT IS PRESENT //do whatever here, I use a toast notification but you can use an alert or anything you want console.log('Error, please verify the entered data'); }else if(!errorMsg && !successMsg){ //IF NO ERROR AND NO SUCCESS MESSAGE IS PRESENT (When you select SAME FORM option on datapage submission) console.log('Record has been saved'); }else if(successMsg){ //IF THERE IS A SUCCESS MESSAGE (When you select DISPLAY A MESSAGE after submitting the datapage) if(successMsg.innerText == 'DELETED'){ //In the message box, you must type DELETE so it recognizes you are deleting something and you can customize the message shown to the user. console.log('Record was successfully deleted'); }else if(successMsg.innerText == 'SAVED'){ //In the message box, you must type SAVED so it recognizes you are saving/updating something and you can customize the message shown to the user. console.log('Record has been saved'); } } }); </script> Inside a HTML block in your datapage, I recommend you to add this code to control that the loader is hidden when datapage loads: <script type="text/javascript"> document.querySelector('#loader').style.display = 'none'; </script> Happy coding!
  2. Hi, Maybe you can share a sketch of what you would like to reach in regards to Data Visualization for your app to show you some solutions that you might be interested in.
  3. Hi, I think you might want to learn yourself about writing API coding or hire a developer since these type of topics are difficult to manage to get your desired results. Good luck.
  4. Hi, This is a many to many relationship case as I have understood. So, you give an ID to each of your lecture entries, then you have a third table to JOIN all this data together without restrictions. So in this new table, you only need a field for your Lecture_Rel_ID and other for the tag. If your tag is coming from another table, then just put the Tag_Rel_ID in this new table. I hope this can give you some guidance or light about further steps you might need to take to achieve what you are looking for. Regards.
  5. This is a very specific requirement, I would recommend you trying Caspio Professional services or hiring an independant developer to achieve what you need.
  6. Does your payment gateway offer webhooks or messaging service for each transaction? What is the payment gateway you are using?
  7. Even though the standard payment flows that Caspio offers are very good, @Bradl is right, no recurring payments are available. I would like to recommend you trying this third party API connector which allows you to connect your payment processor directly to Caspio.
  8. What you are looking for is possible with the AWS S3 API, there is a method to create a signed URL to your file and you can set the live time to 1minute for example so links are valid only for that time frame, anyone using the link out of that frame will get an error message from aws. It is not necessary to set your bucket public and the user get a more natural experience since it is secure without having to put in a password everytime he wants to view a file. Process starts from putting the initial file since it has to somehow relate to your Caspio record, it could be a complex process but it is a completely doable integration. This is not, unfortunately, a do yourself task if you do not have the technical knowledge about APIs. I recommend you to hire a developer for that, or if you want to give it a try, AWS has good documentation on using their API. I hope this can help you solving your issue.
  9. I think this Caspio tutorial is what you are looking for. I hope it can be of help. Regards.
  10. Hi, Yes, passing the WordPress logged in user email as a parameter is completely possible. However, you must be a bit techie to get it done, you could create a button using the WP method wp_get_current_user() in the PHP of your site and then pass the email as URL parameter. I found this article on the web which could help you If you do not have the expertise of doing something like this, I would encourage to hire someone to do it for you as you may cause serious damage to your site if it is not done properly. I hope this gives you some light on what you are trying to do. Best Regards.
  11. Hi there, Based on my experience, these type of services such as Squarespace or Weekly suffer some limitations when combining it with such a powerful service like Caspio. I would rather advise to create your own HTML site for hosting your web application, you will discover it is easy and the interface and other functionalities have no limits, you on control over everything. Another good alternative, in case you do not want to play with HTML coding is a WordPress site, you can manage your pages in the way you need with a drag and drop site builder. It all depends on your needs. I invite you to see this app I created with Caspio so you really see Caspio potential when using custom HTML interface: CASPIO WEB APP EMBEDDED IN HTML SITE
  12. If you want to copy data from one account to another, then you can try using the Caspio API. However, you must be aware that this could be a costly operation depending on how many records you are copying. If you share why you are trying to do somethink like that, maybe we can find a work around. Regards.
  13. Thanks, the following code should work: <a href="#" id="myLink_[@field:Nurse_ID]" target="_blank"></a> <script> if([@calcfield:1#] > 0){ document.getElementById("myLink_[@field:Nurse_ID]").innerHTML = "Edit Password"; document.getElementById("myLink_[@field:Nurse_ID]").href = "https://MyAcct.caspio.com/dp/1234?Nurse_ID=[@field:Nurse_ID]"; }else{ document.getElementById("myLink_[@field:Nurse_ID]").innerHTML = "Add Password"; document.getElementById("myLink_[@field:Nurse_ID]").href = "https://MyAcct.caspio.com/dp/1234?Nurse_ID=[@field:Nurse_ID]"; } </script> I was not able to test this code but please let me know if it works as expected.
  14. Hi @BFuchs Your code is not working for all rows since you are generating several items with the same id "myLink", remember each id must be unique. Could you please identify a field within the table which is unique so I can provide you with the proper JS? Tell me the full name of the unique field.
  15. Hi @Ras2019 What is the datatype for [@authfield:Company_Users_tbl_Company_ID] field? Is it autonumber, random ID, GUID??
  16. Hi @gsgriffin Your question seems to be a bit confusing. Do you have a sample page we can look at to see what the issue is? Regards
  17. douvega

    Estimate app

    It seems to me that you need a one to many relationship since one bid can contain many materials. https://howto.caspio.com/tables-and-views/relationships/
  18. I posted a NodeJS sample code to get the authorization token in the following post: You can reuse the code for making more calls as needed.
  19. In case someone is looking to connect to the CASPIO API using NodeJS, here is the code sample to get the authentication token. const https = require('https'); const querystring = require('querystring'); const data = querystring.stringify({ "grant_type": "client_credentials", "client_id": "[INSERT CLIENT ID HERE]", "client_secret": "[INSERT CLIENT SECRET HERE]" }); const options = { protocol: 'https:', host: '[INSERT CASPIO ACCOUNT HERE].caspio.com', path: '/oauth/token', method: 'POST', headers: { 'Content-Type': 'application/json' } }; const req = https.request(options, (res) => { console.log(`statusCode: ${res.statusCode}`); res.on('data', (d) => { process.stdout.write(d); }); }); req.on('error', (error) => { console.error(error); }); req.write(data); req.end();
  20. Replace your code with this: <script type="text/javascript"> function f_listbox(fieldObj) { //Set field to multi-select fieldObj.multiple = true; //Get field values var values = fieldObj.value; if (values.indexOf(",") > 0) { for (var i=0 ; i < fieldObj.options.length; i++) { if(fieldObj[i].value == values) { fieldObj.remove(i); break ; } } var arr = values.split(", "); for (var j=0 ; j < arr.length; j++) { for (var i=0 ; i < fieldObj.options.length; i++ ) { if(arr[j]== fieldObj.options[i].value){ fieldObj.options[i].selected = true; break ; } } } } } setTimeout(f_listbox(document.getElementById("YOUR:FIELD:ID")), 20); </script>
  21. Hi @davidhshugar I know you have sorted this partially, however, I would bring another solution for you. You can use REST API to post (create) the record everytime a user opens the webpage. I recommend you using this service which lets you do these type of integrations very quick. No datapage autosubmit needed but it is either JS or jQuery dependant to accomplish your goal. I hope you can explore this option, if you need help send your questions.
  22. Maybe you are missing a variable in your JS since that post is made to have your options selected. Please send the JS you are using to check it.
  23. It would be better to hide buttons from the Style directly. Create a new Style and apply it to the datapage you would hide the buttons from. Go to Source tab inside the new style and then select "All" from the left tree options under Datapage Elements section. Look for the type of container you are trying to hide, selections might be: cbSubmitButtonContainer, cbBackButtonContainer, cbDeleteButtonContainer, cbSearchButtonContainer, cbLoginButtonContainer, cbUpdateButtonContainer, cbPasswordRecoveryButtonContainer, cbPasswordResetButtonContainer Find what you are looking for and add the following line inside the class attributes: display: none; That way you will be hidding the buttons you want from the datapages you want without using JS. I hope it helps
  24. Hi @ronbrumbarger, You can not access data from another table within a table. You can surely access cross table data from Calculated fields in your datapages. What is the purpose of having something like that in your app? Generally, there are workarounds that might work for you but you must be more specific about why you are trying to do that. Looking forward to hearing from you...
  25. Hi @wimtracking2, Reason is because you can not call List - String fields with the API. You must change how you multiselect stuff. My advise would be to explore 2 options: Change from List - String to Text64000 and use a JS or jQuery plugin in your datapage such as https://select2.org/getting-started/basic-usage Follow this Caspio solution for a Multiselect Listbox option: https://forums.caspio.com/topic/4315-js-multiselect-listbox-in-update-datapage/ This would store selections as comma separated values and Zapier will be capable of reading the field values. I hope it helps.
×
×
  • Create New...