Jump to content

DefinitelyNot31337

Caspio Guru
  • Content Count

    116
  • Joined

  • Last visited

  • Days Won

    8

DefinitelyNot31337 last won the day on February 27

DefinitelyNot31337 had the most liked content!

3 Followers

About DefinitelyNot31337

  • Rank
    Advanced Member

Recent Profile Visitors

356 profile views
  1. Hi @kpcollier Try this solution: 1. Add a Calculated Field with a syntax similar to this one. CASE WHEN DATEDIFF(day, [@field:date], '[@cbTimestamp]') >= 21 THEN 'Expired' END 2. Add an HTML Block with this Syntax <span custom-data="[@calcfield:1]">[@field:date*]</span> 3.) Easily style this HTML Markup in your Styles (CSS Rules). I'd suggest, in the header: You can post this everywhere you want: <style> [custom-data="Expired"] { background-color: red; } </style> Hope this helps. `DN31337!
  2. Hello @Pixomar, Harbinger's answer works. To implement this in your Tabular Report, paste the code below in the footer of your Configure Results Page Fields: By latest data, I assume it's either the first or last record in your result set. Otherwise, let me know how you define "latest". <style> .blink_me { animation: blinker 2s linear infinite; } @keyframes blinker { 50% { opacity: 0; background: red; color: black; } } </style> <script> var records = document.querySelectorAll('.cbResultSetDataRow'); // First: 1 | Last: records.length var recordIndex = 1; records[recordIndex-1].classList.add("blink_me"); </script> Regards, DN31337!
  3. @DesiLogi, Try adding these lines of code on the Footer of Configure Fields for Bulk Edit: <script> var bulkEditSubmit = document.querySelector('.SimpleButton.ActionButton[value=Update]'); console.log(bulkEditSubmit); setTimeout( () => { bulkEditSubmit.click(); }, 1000); </script> Worked for me. Make sure that you are on the Configure Fields for Bulk Edit section of your DataPage, and NOT on the Configure Results Page fields. Also, do note that the Update button might be initially disabled, especially if there are no fields that receive a parameter . P.S. The script I provided is a workaround, it synchronously waits for 1 second so Update button is enabled before it is clicked. I'll update this (or follow me up if I don't) when I find an asynchronous solution to this.
  4. hi @kpcollier, I believe what you want is a UNION of both tables, and NOT a VIEW. Here's a good article differentiating the two: https://www.essentialsql.com/what-is-the-difference-between-a-join-and-a-union/ Unfortunately, Caspio does not have a direct table operation that allows UNION of both tables. The closest we can do is to create another table that has the common fields of your first two tables. We can, then populate the new table with Triggered Actions or Tasks to yield your desired result. After, then, just use the new table as your DataSource. I hope this helps. DN31337
  5. Hi, In case someone might be loooking for this solution, I am attaching a solution of five formulas that will extract the nth element in a delimiter-separated list on string (in this case, the delimiter is a semi-colon). To upload this solution to your account, refer to this documentation: https://howto.caspio.com/apps/importing-an-app/ Hope this helps, DN31337 zapier_source_2019-May-18_2037.zip
  6. Try this one. <style> [class*=cbSearchButtonContainer] { display: none; } </style>
  7. Think of 'action' as your 'Tech Status'. > By default, it will not return a 'Tech Status' of Completed > You can add another criteria for 'Tech Status' to filter with other values as well > The only time Tech Status = 'Completed' will be returned is if Criteria Two is checked, or if other criteria were satisfies such condition `DN31337
  8. If you're using a DataSource field (i.e. field coming from your DataSource / Table), you may just set a custom localization format of: d/M/yyyy t Works fine for me. `DN31337
  9. With how Caspio's currently doing it, it's just not worth implementing a JavaScript solution over making do with the dirty workaround provided. But tell you what, you may use these Custom Image URLs. Just replace xxx with your Integration URL or Account Friendly Sub-domain https://xxx .caspio.com/images/dp/RA_details_go.png https://xxx .caspio.com/images/dp/RA_edit_pencil.png https://xxx.caspio.com/images/dp/RA_delete_cross.png *DN31337~
  10. Hello @kpcollier, If I correctly assumed what you want to achieve, this could've been done with JavaScript. However, seeing that each Action's related HTML Elements, <a>and <span>, not grouped [i.e. Corresponding elements of View Details, Edit, (and possibly Delete) not having the same HTML Parent], we might be better off doing a dirty workaround instead of having JavaScript intervene with the HTML document. Are you ready for the dirty workaround? Well, you can just cheat by interchanging "View Details" and "Edit" on Styles and Localizations. Below are images of what you need to change. ------------------------------------------------------------------------------------------------------------------------ Hope this helps in a way. Best, return of DN31337
  11. I think it's worth mentioning that data manipulation with the Tasks feature triggers Triggered Actions. You might to disable your Trigger(s) first when running Tasks. Regards, DN31337
  12. Hello TroubleShooter, It is possible with a little help from our friend, JavaScript. Just paste this code snippet to your Footer (HTML Editor should be disabled from the Advanced Tab (as usual)) <script> var frm = document.querySelector(`[action*="[@cbAppKey]" `); frm.addEventListener('DOMSubtreeModified', function() { frm.querySelectorAll('input').forEach( function(elem) { if (elem.disabled == true) elem.parentNode.parentNode.parentNode.classList.add("elem-disabled") else elem.parentNode.parentNode.parentNode.classList.remove("elem-disabled") }); }) var event = new Event("DOMSubtreeModified"); frm.dispatchEvent(event); </script> What this does is, it adds/removes the class of "" to the table row (<tr>) of the disabled element. This enables us to target specific fields related to disabled elements via CSS. To style your elements, you may use the following CSS Rules to be pasted on your DataPage Header (HTML Editor should be disabled from the Advanced Tab (as usual)) <style> /* .elem-disabled row itself */ .elem-disabled { background: green !important; } /* label child elements of .elem-disabled */ .elem-disabled label { color: blue !important; } /* td elements of .elem-disabled */ .elem-disabled td { color: red !important; } /* All child elements of .elem-disabled */ .elem-disabled * { color: yellow !important; } </style> Hope this helps. Happy Hacking! DN31337
  13. Hi, As I understood OP's inquiry, I think they wanted to submit the timestamp of the most recent update to the Dropdown, and not when the DataPage actually loaded. Looking at the answers above, what the solutions do is assign '[@cbTimestamp]' to EditRecordpatient_status_change_timestamp everytime EditRecordpatient_status is updated. Do note, though that [@cbTimestamp] is a STATIC value once the DataPage has been rendered. Meaning, it's value is the current timestamp when the DataPage is loaded. It does not change after then, even if the HTML 'change' event is emitted. The answer to the original question would be: <script> var dropdown = document.querySelector('[id*=EditRecordpatient_status]') var tstamp = document.querySelector('[id*=EditRecordpatient_status_change_timestamp]') dropdown.onchange = function() { var dt = new Date(); tstamp.value = `${dt.toLocaleDateString()} ${dt.toLocaleTimeString()}` } </script> Cheers! DN31337
  14. Hello @TroubleShooter, Yes, you can. Currently, it is only possible with JavaScript. The idea is to place the Registration Form and Standalone Login Page side-by-side (or at least, in the same page). You may hide the Login Form ( using <div style="display: none;"></div> on the Header/Footer of the DataPage || More about here...), on your Registration Page but I rather keep them visible so the users can opt to just log-in if they already have an account; or register, if they don't. After registration, JavaScript will fill-out the login form, and submits it programatically, therefore logging-in the newly registered user. The only requirements to this implementation are: 1.) Login DataPage and Registration Form DataPage are deployed on the same page. 2.) Both DataPages are AJAX-Enabled! 3.) Headers/Footers should have the HTML Editor disabled from the Advanced tab. Without futher ado, let's do this. 1.) Open DataPage Configuration for your Registration Page: 2.) Go to 'Configure Fields Section' 2.1.) Add a Header and Footer (Disable HTML Editor from the advanced tab) 2.2.) Paste the code snippet in the Footer and modify the following information. <script> document.addEventListener('BeforeFormSubmit', function() { var registrationDP = "[@cbAppKey]"; var loginDP = "378fd3458dfsjhefjhqerwfdsyui3274239"; //Replace with the AppKey of your Standalone Login Scren var username_field = "username"; //replace with the name of your username field (CASE SENSITIVE!) var password_field = "password"; //replace with the name of your password field (CASE SENSITIVE!) //No modifications necessary from this point onward. document.querySelector(`[action*="${loginDP}"] [id*=xip_username]`).value = document.querySelector(`[action*="${registrationDP}"] [id*=InsertRecord${username_field}]`).value document.querySelector(`[action*="${loginDP}"] [id*=xip_password]`).value = document.querySelector(`[action*="${registrationDP}"] [id*=InsertRecord${password_field}]`).value }) </script> 5.) Go to 'Destination and Messaging' 5.5) Set Destination after record submit to: Display a message; Disable the HMTL Editor! 5.6) Paste the code snippet below; then modify. Registered Successfully. <script> var loginDP = "378fd3458dfsjhefjhqerwfdsyui3274239"; document.querySelector(`[action*="${loginDP}"]`).submit(); </script> After saving, you should be good to go. Working example: https://stage.caspio.com/support/forums/DefinitelyNot31337/register-login/index.html Application Export Package: CaspioData_2019-Apr-02_0219.zip Good luck and happy hacking! Regards DN31337!
  15. Hello guys, Do note that you will only be able to create this formula field IF YOUR TABLE IS STILL CLEAN. **No invalid/restricted record exists on your table yet. The line CAST( 'a' + 1 as INT) will definitely cause an error therefore preventing invalid data input. This means that if you already have data that will cause this error, the database will just NOT let you create this formula field.
×
×
  • Create New...