Jump to content

Glitch

Caspio Guru
  • Posts

    114
  • Joined

  • Last visited

  • Days Won

    12

Reputation Activity

  1. Like
    Glitch got a reaction from ColBasicuser in Creating Audit Trail via Triggered Actions   
    If you want to retrieve the old value and the new value at the same time, like what I mentioned on the previous response, all you need to do is to join the inserted table with the own table. 
     
    Here's a screenshot on how to do that. (This is just and idea how to do this, though I don't know your exact workflow)

     

     
    On the table where you're inserting, this will be the value:

     
    I hope this helps.
  2. Thanks
    Glitch reacted to Vitalikssssss in How Can I Format A Text Field As A Dollar?   
    Hi @bbewley, @kpcollier,

    You may try using this JS which should go to the Footer:
    <script type="text/javascript"> function formatAsDollars(el) { el.value = el.value.replace(/[^\d]/g,'').replace(/(\d\d?)$/,'$1').replace(/^0+/,'').replace( /\d{1,3}(?=(\d{3})+(?!\d))/g , "$&,"); el.value = el.value ? '$' + el.value : ''; } let fields = ["FIELD_1", "FIELD_2"]; //specify your fields here fields.forEach(element => { element = "InsertRecord" + element; // replace "InsertRecord" with "EditRecord" for Details/Single Record Update DP document.getElementById(element).onkeyup = function() { formatAsDollars(this); } document.getElementById(element).onchange= function() { formatAsDollars(this); } }); </script> Pay attention to comments.
    Hope this helps.
    Vitalikssssss
  3. Like
    Glitch got a reaction from DefinitelyNot31337 in Triggered email when field changes   
    Hi @matstein,
    You can consider automatic emails as well, but this will not indicate what field was changed, and what it was changed to. 

    You are correct that this workflow should use a triggered action. I have set up an easy Triggered action on how to achieve this. 
    FIRST, the trigger should run on UPDATE.
     
    NEXT is to join the INSERTED table with the OWN Table. This way, we can retrieve both updated value and the previous value. 
    Here's a screen shot of how the Trigger should be set up. 

    (My screen shot looks funny)
    I hope this helps. 
     
    I also have attached the table, in case you want to test it for yourself 
     
    SendEmail_2019-May-02_1717.zip
     
    To use SELECT along with the Send Email, just click the Gear button on its right. 
     
    Regards.
    Glitchhhhh
  4. Like
    Glitch got a reaction from DefinitelyNot31337 in Formula Error   
    Hi there, that's correct. the reason why it's returning an error is if you have 0 on the division. You can just add a NULLIF to your statement. 
     
    You can use this formula:
    ([@field:Elig_Reg_Riders]+[@field:Elig_Spec_Need_Riders])/NULLIF(([@field:Regular_Runs]+[@field:SPED_Runs]),0)
     
    Let me know if this works.
  5. Like
    Glitch got a reaction from Syvill in Multiple submission base on user input   
    If you want the maximum submission to be just 12, then you can just set the fields inside the QTY field to 12. 
    The inner join you see up there in the select will serve as the loop that while the QTY is greater than or equal to a certain value, then, continue adding the field. 
  6. Like
    Glitch reacted to DefinitelyNot31337 in Multi Select Listbox   
    Hello @Jess147,
     
    The way Caspio setup their custom element for List-Strings seems more complicated that it looks.
    You may try adding this poorly-written code to your footer to limit the selections on your Submission Form.
    Currently, it only works on Multi-Select Listbox. I'll try to get back to this thread another time so we can implement a better solution and add support to Multi-Select Dropdown, as well as other types of DataPages.
     
    Cheers!
    DN31337
     
    <script> setTimeout(function() { var fieldName = 'ls'; //replace with your actual field name var cbs = document.querySelectorAll(`[id*=InsertRecord${fieldName}] .Item`) cbs.forEach(function(elem) { elem.addEventListener('click', function(e) { setTimeout(function() { var counter = document.querySelectorAll(`[id*=InsertRecord${fieldName}] .Item [type=checkbox]:checked`).length; console.log(e.target, counter) if(counter > 2) { //replace with the limit you wish e.target.click(); } }, 333); }); }); console.log('deChecker ready!'); }, 1500) </script>  
  7. Thanks
    Glitch got a reaction from taylorswiftlover in Centered Report Search   
    Or you can add this line on your CSS> 
    <style> table[class*="cbFormTable"] { border: none !important; background: white; margin: 0px auto !important; } </style>  
    Hope this helps. =) 
  8. Like
    Glitch reacted to DefinitelyNot31337 in Passing field values with ampersand (&) over query String   
    Hello @TroubleShooter,
     
    The reason why the ampersand symbol is being cut is because Caspio renders the link literally. In this example:
    <a href="https://www.google.com?myParameter=[@field:someField]"> Link </a>  
    If "someField" evaluates to "Some Value & Another Value" then the mark-up would result to 
    <a href="https://www.google.com?myParameter=Some Value & Another Value"> Link </a>  
    This is when urlencoding comes into play. What this does is substitutes the special characters in a standard HTML format which interprets characters a different way.
     
    You may try using my code snippet below.
    1.) Just replace the link ID with the id attribute of your link.
    2.) repeat the addParameter function as needed. The first argument is your parameter name, and the second argument is your field value.
    <a href="#" id="link-1">MyLink</a> <script> // DO NOT TOUCH FROM THIS POINT var params = []; addParameter = function(qs, val){ params.push(`${qs}=${encodeURIComponent(val)}`); } //UP TO THIS POINT var link_id = "link-1"; var base_url = "https://SomeDomainFrom.caspio.com/dp/926560as124321324dasd00a6523f123123624543123423fc0453b9093"; addParameter('boo', '[@field:SelectedAction]'); //repeat as needed addParameter('far', '[@field:SelectedAction]'); // DO NOT TOUCH FROM THIS POINT var queryString = params.join("&"); document.querySelector(`#${link_id}`).href = `${base_url}?${params.join("&")}` //UP TO THIS POINT </script>  
    Works for me.
     
    -DN31337!
  9. Thanks
    Glitch got a reaction from kpcollier in Align Buttons   
    I think there can be an easier way here. If you're using the same style as the buttons, might as well hide the ID instead of the class, so you can use the class when creating the button.
    You can hide the ID of the element, something like this:
    input[id^='Submit']{display: none !important;}
    so you can create this button>
     <input type="submit" name="Submit" value="Submit" class="cbSubmitButton">
     <a href="REDIRECTION LINK"><button class="cbSubmitButton">Choose Again</button></a>
     
    This would work the same, just avoiding that extra effort to restyle the button. ❤❤

    @kpcollier, when you put in the code> display: none, this should hide the button. If you are using responsive code, you may want to add this piece of code inside the media query. Maybe that will help. 
     
    Glitch();
  10. Like
    Glitch reacted to DefinitelyNot31337 in Highlight Previous days   
    Hello @Glitch
     
    You may try pasting this code in the Footer section of "Configure Fields for Calendar" of your DataPage Configuration. Do make sure that HTML Editor is Disabled from the Advanced Tab.
    <script> var curr = document.querySelector('.cbResultSetCalendarTableNowCell .cbResultSetCalendarField') var dates = document.querySelectorAll('[class*=cbResultSetCalendarField') for (let [idx, elem] of dates.entries()) { if (elem == curr) break; elem.parentNode.style.background = "red"; } </script>  
    Hope this helps.
    DN31337!
  11. Thanks
    Glitch got a reaction from DefinitelyNot31337 in Highlight Previous days   
    Awesomesauce. Thanks @DefinitelyNot31337!
  12. Thanks
    Glitch got a reaction from Role21 in Input Time   
    Hi there, I think Datediff formulas does work on formula fields, except if you are using GetDate().
    Datediff will work if the dates are deterministic (static). So if you're just computing for how many minutes were spent between start time and end time, DateDiff(minutes, starttime, endtime) should work in the Formula datatype. 


  13. Thanks
    Glitch reacted to DefinitelyNot31337 in Multiple Submissions Of Form In One Page   
    Continuation from my previous response:
     
    How this works is:

    DataPage "tbl Web Form" has this script in the Footer (HTML Editor disabled from the Advanced Tab). This script is responsible for submitting the instantiated form when function bulkSubmit() is called from  HTML DataPage (i.e. when Bulk Submit! button is clicked).
    <script> function displayMessage (evt) {   document.querySelector(`.cbSubmitButtonContainer [id*=Submit]`).click(); } if (window.addEventListener) {  // For standards-compliant web browsers  window.addEventListener("message", displayMessage, false); } else {  window.attachEvent("onmessage", displayMessage); } </script>  
    Next, let's talk about HTML Page (DataPage). So, we have two buttons. One, for instantiating a Submission Form DataPage upon click; and another button to submit all the instantiated DataPages.
    <button type="button" onclick="addIframe()"> Add </button> | <button type="button" onclick="bulkSubmit()"> Bulk Submit! </button>  
    We also have an HTML container for the instantiated DataPages.
    <div id="ifr-container"></div>  
    Finally, we have our JavaScript functions definition:
    <script type="text/javascript"> var ifrContainer = document.getElementById('ifr-container'); function addIframe() { var ifrCount = ifrContainer.childElementCount; console.log(ifrCount); ifrContainer.insertAdjacentHTML('beforeend', `<iframe class="cdr-iframes" src="[@app:URL_1]"></iframe>`); } function bulkSubmit() { document.querySelectorAll('iframe.cdr-iframes').forEach(function(elem){ elem.contentWindow.postMessage("", "*"); }); } </script>  
    addIframe() inserts a new instantiation of the Submission Form in the HTML container.
    bulkSubmit() submits the instantiated Submission Forms one by one
     
    DN31337!
  14. Like
    Glitch got a reaction from ManokNaPula in Ticketing System   
    Hi Scarlet,
    I figured out a way to do this on trigger. The idea is, you'll prevent using two DataPages since the Timestamp is being generated from the trigger.
    This is a sample trigger you can use. 

    So upon update, you can update the #inserted Start time if the technician (which in your case is the ticket handler), has been changed. And update the #inserted EndTime if the #inserted Status is closed. 
    The case when statement there, is to update the fields only if the respective fields has been changed. 

    Works like a charm.

    Hope this helps, Scar.
    Glitch ();
  15. Haha
    Glitch got a reaction from SinJunYoung in 90-Day Password Expiration   
    Hi there!
    The previous reply is correct, you need to have the Last Update field. However, I think Javascript is not necessary. JS would probably be my last option on workarounds. 

    So, how can you do this without Javascript?
    You can use Tasks to send out email for the users who has outdated Email. You can set it up like this: (You can change the conditions based on your requirement)

    On the Message Body, you can put in the link of the DataPage that will enable the users change their passwords. 
    Of course, you can add some actions in the task as well, like for example, once a user does not change the password after 90 days, this user will be inactive (using checkboxes prolly)

    Hope this helps();
    Glitch 
  16. Like
    Glitch got a reaction from DefinitelyNot31337 in Creating Audit Trail via Triggered Actions   
    If you want to retrieve the old value and the new value at the same time, like what I mentioned on the previous response, all you need to do is to join the inserted table with the own table. 
     
    Here's a screenshot on how to do that. (This is just and idea how to do this, though I don't know your exact workflow)

     

     
    On the table where you're inserting, this will be the value:

     
    I hope this helps.
  17. Like
    Glitch reacted to DefinitelyNot31337 in Search Filter For A Calculated Field   
    Hello. You must be looking for Formula Fields or Triggered Actions.
    https://howto.caspio.com/tables-and-views/data-types/formula-fields/
    https://howto.caspio.com/tables-and-views/triggered-actions/
     
    If the Calculated Field is processed using the other fields on the same record, you may use Formula Field. Otherwise, if you are referencing to data outside the row/record, you'd need to use a Triggered Action.
  18. Thanks
    Glitch got a reaction from kpcollier in Adding a Prefix with Calculated Value   
    Hi there,
    Are you doing this formula using a Calculated Field?
    I think you need to convert the Virtual field first as a character.
    I tried this on my end and the formula worked!
    '2-' + CAST([@cbParamVirtual1] as VARCHAR)
    I hope this helps.
     
    Glitchin'
  19. Thanks
    Glitch got a reaction from DefinitelyNot31337 in Copy search field value to input field   
    Hi @philippe,
    You can use Javascript for this. 
    First, you need to pass the parameter from the search form. 

    Then inside your Results Page, add a Header and Footer.
    Put this code inside your footer (make sure to disable HTML Editor)
    <script> // Replace Value to Parameter name var passID = '[@Name]'; // Replace Value to the Field Name of Event ID inside table var this_field= 'Name'; var insert_field = document.querySelector('form[action*="[@cbAppKey]"] #InlineAdd' + this_field); insert_field.value = passID; </script>  
    Just a little something I learned from this post: 
    Thanks Mahfriend 

    Sample Page: https://c0acd927.caspio.com/dp/e6cb6000e2c14d25606f4cd1ae1b

    I hope this helps.

    Glitch.
     
  20. Thanks
    Glitch got a reaction from Philippe in Copy search field value to input field   
    Hi @philippe,
    You can use Javascript for this. 
    First, you need to pass the parameter from the search form. 

    Then inside your Results Page, add a Header and Footer.
    Put this code inside your footer (make sure to disable HTML Editor)
    <script> // Replace Value to Parameter name var passID = '[@Name]'; // Replace Value to the Field Name of Event ID inside table var this_field= 'Name'; var insert_field = document.querySelector('form[action*="[@cbAppKey]"] #InlineAdd' + this_field); insert_field.value = passID; </script>  
    Just a little something I learned from this post: 
    Thanks Mahfriend 

    Sample Page: https://c0acd927.caspio.com/dp/e6cb6000e2c14d25606f4cd1ae1b

    I hope this helps.

    Glitch.
     
  21. Haha
    Glitch reacted to DefinitelyNot31337 in Move Buttons to Side Of Search Box   
    - wrong post. please disregard
     
    Thank you
  22. Like
    Glitch got a reaction from DefinitelyNot31337 in Authentication not working across all pages   
    Hi @shaferam.
     
    Are you still using the old Integration URL? That might be causing the issue. You should replace the Integration URL to the Deployment URL. 
    Please check out this link: https://howto.caspio.com/release-notes/caspio-bridge-14-0/14-0-impacted-areas/
     
    Hope this helps. 
  23. Like
    Glitch got a reaction from MiCro in Trigger Sum   
    You should add the sum to the inserted Value.

     
    Reading the trigger, You are only summing up the CommentHRS. Meaning to say, the inserted one is still excluded, since you are  still on the process of inserting the Data.
     
    I hope this helps. 
  24. Like
    Glitch reacted to douvega in Sms   
    You can also use INTEGROMAT. I have found this service very useful to connect to many third party apps and it is very affordable.
    I have already integrated it with ClickSend as SMS provider and it works really well.
    I hope you can build what you need with all the suggestions provided for this post.
    Regards.
  25. Like
    Glitch reacted to DefinitelyNot31337 in Login after User Registration   
    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!
×
×
  • Create New...