Jump to content

Wikiwi

Caspio Guru
  • Posts

    116
  • Joined

  • Last visited

  • Days Won

    12

Reputation Activity

  1. Thanks
    Wikiwi got a reaction from kpcollier in [FYI] How to separate comma delimited input and insert it all in one column   
    I had this workflow that a user will enter Names in one text filed separated by a "," and that input would be inserted on a separate table but 1 name per column. To solve this I created a small Trigger that will separate all inputs and insert them to a different table.
     

    The trigger above can also be modified to fit other "separator". 
  2. Like
    Wikiwi got a reaction from roattw in [FYI] Removing HTML tags to data inputs using RICH text editor using JavaScript   
    I found another solution in removing HTML tags in the data saved in Rich text editor. This is more if an alternative to this solution. Specially for those who doesn't have access to Triggered action.
    First you would need another field in your table that will store the plain text version of the actual input. Put that field in your Submission form and add a HEADER and FOOTER in your DataPage. Go the the FOOTER of your DataPage and disable the HTML editor in the Advanced tab. Paste the code below in your footer:  
    <script type="text/javascript"> //This will hide the field for the "plain" text var non_formatted_txt = document.querySelector("#InsertRecordFIELDNAME_2"); non_formatted_txt.style.display = "none"; document.addEventListener('BeforeFormSubmit', function(event) { //This will replace all the HTML tags with blank var input = document.querySelector("#InsertRecordFIELDNAME_1").value.replace(/<\/?[^>]+(>|$)/g, ""); non_formatted_txt.value = input; }); </script> NOTE: replace FIELDNAME_2 with the actual fieldname of your field for the "plain" text and replace FIELDNAME_1 with the actual field name of the rich text editor field.
    Sample input :
       
    Actual table value:

    Non formatted value:

     
     
  3. Like
    Wikiwi got a reaction from vidierre in [FYI] Item picker for characters with diacritical marks   
    Just wanted to share this usecase to allow user to input characters with diacritical marks in them(è, î, ñ, â).
    This small modification will help users input characters with diacritical marks using a dropdown list and a button. For this scenario, I will use a submission form but this can be modified and can be used to Single Record Update and Details Page.
    First, you would need 2 new fields for each text field or text area you wish to implement.
    - 1 virtual field set to a dropdown list that will contain the characters.
    - 1 HTML block that will serve as a button and container of the javascript.
    Here is the script that needs to be inside the HTML BLOCK:
    <style> #letter{     background: #3B6AD2;     border: none;     color: #FFFFFF;     display: inline-block;     font-family: Arial, Helvetica, sans-serif;     font-size: 12px;     font-weight: 400;     text-align: center;     text-transform: uppercase; } </style> <button type="button" id="letter">pick</button> <script> document.getElementById('letter').addEventListener('click',AddLetter); function AddLetter(){ document.getElementById("<textfield_ID>").value = document.getElementById("textfield_ID").value + document.getElementById("<virtualfield_ID>").value; } </script> Sample Output:

  4. Like
    Wikiwi got a reaction from Tubby in [FYI] How Conditions(CASE WHEN) is validated   
    This is not really a question, just wanted to share what I found out when experimenting with calculated fields, calculated values, and formula fields.
    Basically when you created a formula that contains conditions the system pulls the first record in your table and run those fields in your condition and if that doesn't encounter an error then the formula is considered "valid".
    As an example, lets say you have 2 date fields  (Date_1  and Date_2) and you used this fields in the formula below
    CASE
    WHEN [@field:Date_1 ]  = [@field:Date_2] THEN 1
    WHEN [@field:Date_1 ]  < [@field:Date_2] THEN 2
    ELSE 1/0
    If your source table doesn't have any records the formula will be valid since  'null' is equals to 'null' and the 1st WHEN condition is satisfied.
    If your source table have records and Date_1 is equals to  Date_2 then the formula is still valid since it satisfies the 1st WHEN condition
    If your source table have records and Date_1 is less than Date_2 then the formula is still valid since it satisfies the 2nd WHEN condition
    if your source table have records and Date_1 is not equals, or not less than Date_2 then the formula will encounter an error since this will fall to the ELSE condition, and 1/0 is a mathematical error.
  5. Like
    Wikiwi got a reaction from researched in Wordpress Login Deployment Fail   
    In addition to what @IamNatoyThatLovesYou said, I used the Shortcoder plugin to deploy DataPages on Wordpress. Basically what you will do is to put the Caspio deploy script in a Shortcoder. That will then generate a "shortcode" and you can copy that in your Code block.
  6. Like
    Wikiwi got a reaction from Pumpedplop in [FYI] How Conditions(CASE WHEN) is validated   
    This is not really a question, just wanted to share what I found out when experimenting with calculated fields, calculated values, and formula fields.
    Basically when you created a formula that contains conditions the system pulls the first record in your table and run those fields in your condition and if that doesn't encounter an error then the formula is considered "valid".
    As an example, lets say you have 2 date fields  (Date_1  and Date_2) and you used this fields in the formula below
    CASE
    WHEN [@field:Date_1 ]  = [@field:Date_2] THEN 1
    WHEN [@field:Date_1 ]  < [@field:Date_2] THEN 2
    ELSE 1/0
    If your source table doesn't have any records the formula will be valid since  'null' is equals to 'null' and the 1st WHEN condition is satisfied.
    If your source table have records and Date_1 is equals to  Date_2 then the formula is still valid since it satisfies the 1st WHEN condition
    If your source table have records and Date_1 is less than Date_2 then the formula is still valid since it satisfies the 2nd WHEN condition
    if your source table have records and Date_1 is not equals, or not less than Date_2 then the formula will encounter an error since this will fall to the ELSE condition, and 1/0 is a mathematical error.
  7. Like
    Wikiwi got a reaction from jbemerge in [FYI] Pop up on first login   
    This use case will have the following parts:

    - Landing DataPage. This is the homepage that your user will go to once they log in.
    - Yes/No field in the User table. This will serve as a marker if a user logged in.
    - Single Record Update DataPage that will serve as the Pop-up window.
    - A new Localizationthat will be used in the Single Record Update DataPage.

    Configuring the POP_UP DataPage
    - Create a new Single Record Update DataPage and change its DataSource to your Users table.
    - Configure "Record Identification" by picking the the unique ID in your Users table.
    - Add the Yes/No field to your webform.
    - Create an HTML BLOCK that will serve as your pop up message.
    - Configure your Yes/No field to be "hidden" and check  "On load, receive: yes".
    - Add a Header and Footer in your DataPage.
    - In the footer, disable HTML editor and put the following script:
    <script type="text/javascript">
    document.addEventListener('BeforeFormSubmit', function(event) {
     window.top.location.reload();
    });
    </script>
    Edit your Landing DataPage
    - Once you have configured your basic Authentication and the pop up DataPage. Add the following code in the header and footer of your Actual DataPage.

    Header:
    <style>
    body {font-family: Arial, Helvetica, sans-serif;}

    /* The Modal (background) */
    .modal {
      display: none; /* Hidden by default */
      position: fixed; /* Stay in place */
      z-index: 1; /* Sit on top */
      padding-top: 5%; /* Location of the box */
      left: 0;
      top: 0;
      width: 100%; /* Full width */
      height: 100%; /* Full height */
      overflow: auto; /* Enable scroll if needed */
      background-color: rgb(0,0,0); /* Fallback color */
      background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    }

    /* Modal Content */
    .modal-content {
      background-color: #fefefe;
      margin: auto;
      padding: 20px;
      border: 1px solid #888;
      width: 60%;
      height: 70%;
    }

    /* The Close Button */
    .close {
      color: #aaaaaa;
      float: right;
      font-size: 28px;
      font-weight: bold;
    }

    .close:hover,
    .close:focus {
      color: #000;
      text-decoration: none;
      cursor: pointer;
    }
    </style>
     
    Footer:
    <div id="myModal" class="modal">
    <div class="modal-content">
        <iframe  name="Acknowledgement_Letter" title="Acknowledgement_Letter" src="<PUT_YOUR_POP_UP_DATAPAGE_URL_HERE>" frameborder="0" style="width: 100%; height: 100%;">Sorry, but your browser does not support frames.</iframe>
    </div>
    </div>

    <script>
    // Get the modal
    var modal = document.getElementById("myModal");

    document.addEventListener('DataPageReady', function (event) {
    if('[@field:firstlogin_checker]' == 'No'){
      modal.style.display = "block";
    }
    });

    </script>
    - In the footer, change <PUT_YOUR_POP_UP_DATAPAGE_URL_HERE> with the deploy code of your pop-up Datapage. Dont forget to add the parameter for your unique ID.

    For example: [DATAPAGE_URL]?email=[@authfield:email]

    Localization of the pop-up DataPage:
    - Create a new Localization.
    - Under Forms/Details Pages>Buttons. Click the "Update" row.
    - Under the Custom text, change the current value to "I accept" or any acknowledgement statement.
    - Hit save and apply this localization to your pop-up DataPage. 
  8. Like
    Wikiwi got a reaction from roattw in Script to select checkbox based on dropdown does not trigger checkbox rule   
    Instead of combining the the standard feature Rules and your script that is causing an issue. why not do all the logic within the script?
     
    <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { const selectElement = document.querySelector('#InsertRecordRole'); const Gradyear= document.querySelector('#InsertRecordGraduation_field'); //this is to get your graduation year field. Gradyear.style.display= "none"; //by default this field is hidden selectElement.addEventListener('change', (event) => { if(selectElement.value == "Resident"){ document.querySelector("#InsertRecordAlumni").checked = true; Gradyear.style.display= "block"; //if dropdown is Resident, alumni checkbox is checked and that also means graduation year should be visible. }else{ document.querySelector("#InsertRecordAlumni").checked = false; Gradyear.style.display= "none"; // incase a user changed the selectElement.value to another option } }); }); </script>  
  9. Thanks
    Wikiwi got a reaction from autonumber in [FYI] Custom Icon inside textbox   
    To add an icon that represents what you would like your user to put in a specific field, you can do the following:
    Download image files that you would like to use as icons. Create a FILE app parameter using the image that you downloaded. Add a Header and Footer in your Datapage and disable the HTML editor. In your Header, paste the following CSS script: #InsertRecordFIELDNAME {
        padding-right: 33px;
        background-image: url(PUT_YOUR_APP_PARAMETER_HERE);
        background-position: 97% ;
        background-repeat: no-repeat;
        background-size: 20px;
    }
    Output: 
    Take note that the code above will put the icon on the right side of your text field. If you want it on the left, you can use the below CSS instead:
     
    #InsertRecordFIELDNAME {
        padding-left: 33px;
        background-image: url(PUT_YOUR_APP_PARAMETER_HERE);
        background-position: 3% ;
        background-repeat: no-repeat;
        background-size: 20px;
    } Output: 

    Replace FIELDNAME with your own field name and do the same thing with the App parameter.

    Also, the code above is used in a submission form, if you are using an update form you may need to change #InsertRecord to #EditRecord. 
     
  10. Like
    Wikiwi got a reaction from KG360 in Add Characters in the beginning of the value   
    If you want to use a triggered action you can create a setup just like below:
    Trigger setup:

    Output:

  11. Like
    Wikiwi got a reaction from KG360 in [FYI] Different Button text/style when in mobile view   
    The scripts below will let you have a different button style when a Datapage is opened on a mobile device. Technically you will have 2 different buttons with the same action/use, 1 for the mobile view and 1 for the desktop view.

    First, create a header and footer field, disable the HTML editor, and put the following STYLE in the header
     
    <style>
    input[name="MobileButton"]{ display: none !important; } /*this line will hide the mobile*/ button by default
    input[name="searchID"]{ display: none !important;} /* this will hide the actual button that*/ comes with the DataPage.

    @media (max-width: 640px) { /*this part will detect the width of the screen*/
        input[name="MobileButton"] { display: block !important;}
        input[name="PCButton"] { display: none !important;}
    }

    </style>
     
    Once that is done, create an HTML BLOCK, disable the HTML editor and paste the following code:
     
    <input type="submit" name= "PCButton" class="cbSearchButton" value="THIS IS THE DESKTOP BUTTON">
    <input type="submit" name="MobileButton" class="cbSearchButton" value="THIS THE MOBILE BUTTON" >
    NOTE: you can also put the above code in the footer. It just depends on the look that you want to achieve. I also changed the value for the 2 button so you can see them change when changing screensize. 
  12. Thanks
    Wikiwi got a reaction from autonumber in [FYI] Removing HTML tags to data inputs using RICH text editor using Trigger/TASK   
    If any of you uses RICH text editor for user inputs, you will notice that the actual data in the table contains HTML tags that describes the format used with the input.
    Ex.

    Will have the following data in your table:

     
    If you want a "clean" version of this text you can create a trigger/task that will remove the HTML tags. You can copy the Trigger below:

    The "formatted_txt" will be the field that uses the Rich text editor and the non_formatted_txt_trigger will contain the "clean" text version. 

    Rich text editor will convert < and > to their entity name which are &lt; and &gt; and a "Non-breaking space" will be converted to: &nbsp;. The following blocks will replace this entity name to their actual value.

     
  13. Like
    Wikiwi got a reaction from SteveT in Import from multiple lines of spreadsheet   
    @SteveT 1 cell in your excel file will correspond to 1 cell in your Caspio table which means 1 row of data in your excel file will be 1 record in Caspio. I would suggest modifying your Excel file first before importing it to Caspio.
  14. Like
    Wikiwi got a reaction from crionsynx in Get the difference of two strings converted to int   
    I also tried to run you formula and its not working properly. I created my own version:
    CASE
    WHEN Charindex('-',[@field:BoxNumber]) > 0
    THEN CONVERT(INT,Left([@field:BoxNumber], Charindex('-',[@field:BoxNumber])-1)) - CONVERT(INT,right([@field:BoxNumber], (Len([@field:BoxNumber]) -Charindex('-',[@field:BoxNumber])))) +1
    ELSE '1'
    END


  15. Like
    Wikiwi reacted to KlisaN137 in [FYI] How to verify domain   
    Hi Caspians,
    I just wanted to share the additional info about how to successfully verify domain: https://howto.caspio.com/verified-email-and-domain/verify-domain/
    1. Go to Account Settings, click on Email tab and under Email addresses and domains
    2. For an unverified domain, click on Unverified Domain and you will be presented with TXT and CNAME records for that domain. 


    3. Copy the TXT record :  caspio_133.yourdomain
    4.  Go to https://mxtoolbox.com/SuperTool.aspx , paste the TXT record and choose TXT Lookup, and click on TXT Lookup:

    5. Do the same thing for CNAME, copy it from your account and paste to the search, but choose CNAME Lookup.
    6. If it says 'DNS record not found' and you already contacted your DNS provider and added records, you can check if you added them correctly, because some Hosts automatically appends domain name to TXT and CNAME records, so they don't require formatting to be like this:
    cas-k1._domainkey.yourdomain   CNAME  dkim1.caspio.com
    but this one:
    cas-k1._domainkey  CNAME  dkim1.caspio.com
    And for TXT record just this: caspio_100 
    Providers that automatically add those are GoDaddy, Squarespace, Namecheap.
    7. If you are not sure if your Host automatically appends domain by again going to https://mxtoolbox.com/SuperTool.aspx, and using CNAME Lookup, you will see who is you DNS hosting provider:

    Then, you can search online for how to add records in this particular DNS.
     
     
  16. Like
    Wikiwi reacted to Aether in Preview is fast. Deployed is slow.   
    Here are the things that I check if I experience slowness in my DataPages that is not mentioned above:
    Internet connection: Make sure it was stable. Number of dropdowns with lookups (and other field that uses lookups): Make sure that you don't have lookups with large amount of options and/or most of your fields uses it.  File/Image rendering: Lessen or not use to much of files in your DataPage. Complex calculation: You can use the Table's formula or trigger if needed. Complex CSS or JavaScript: If you can simplify them, the better. Embeded iFrame codes: Do not use/add this inside a Datapage as much as possible.  I hope this helps.  
  17. Like
    Wikiwi got a reaction from Flowers4Algernon in [FYI] COMMENTS   
    Comments on your script or code can be helpful specially when it gets complicated and larger. This helps you to mark different parts of your code which in turn will help you debug them. I compiled a list of comment tags that can be used on every part of your DataPage whether it's for a calculated field, formula data type, JavaScript, CSS, or HTML.
     
    HTML comment tag:
    <!-- this is 1 line of comment --> or <!-- these are multiple line of comments--> CSS comment tag:
    /* This is 1 line of comment */ or /* These are multiple line of comments */ JavaScript
    // single line of comment or /* This is 1 line of comment */ or /* These are multiple line of comments */ SQL
    -- Singe line of comment or /* This is 1 line of comment */ or /* These are multiple line of comments */  
  18. Like
    Wikiwi got a reaction from kpcollier in Get Exact Age   
    I tried the solutions provide by @DefinitelyNot31337 and @Hastur and it gives me the wrong age (I tried July 13 1999 and it outputs 23 when it should be 22) so I created my own.
    CASE WHEN DatePart(m, [@field:birthday]) > DatePart(m, SysUTCDateTime()) AND (DatePart(d, [@field:birthday]) != DatePart(d, SysUTCDateTime())) THEN DateDiff(year,[@field:birthday],SysUTCDateTime()) -1 ELSE DateDiff(year,[@field:birthday],SysUTCDateTime()) END Hope this helps.
  19. Thanks
    Wikiwi got a reaction from autonumber in Get Exact Age   
    You might want to also check this post for alternative ways to calculate age:
     
  20. Like
    Wikiwi got a reaction from Kurumi in [FYI] Dynamic choices for for a date dropdown   
    I have a workflow that will only let a user enter a date ranging from 7 days before the current date. Obviously a calendar pop up wont work since I can't disable other choices there. So I created a  task that will update the table daily and put the necessary choices that I have. This way its dynamic and I don't need to change it everyday.
    Here is the Task:

    The task above will run every day and will first delete all the existing records within the table and replace it with the new set of 7 days. An example would be. Today is May 10 here in my location and  that will give me May 3 - May 10 of range.
    Table:

    DataPage:

    Note: You can also edit this workflow where when a date is selected that option will be removed from the Table. That will use a trigger that will delete a date when it sees it after a user submission.
  21. Like
    Wikiwi got a reaction from Casper in [FYI] Dynamic choices for for a date dropdown   
    I have a workflow that will only let a user enter a date ranging from 7 days before the current date. Obviously a calendar pop up wont work since I can't disable other choices there. So I created a  task that will update the table daily and put the necessary choices that I have. This way its dynamic and I don't need to change it everyday.
    Here is the Task:

    The task above will run every day and will first delete all the existing records within the table and replace it with the new set of 7 days. An example would be. Today is May 10 here in my location and  that will give me May 3 - May 10 of range.
    Table:

    DataPage:

    Note: You can also edit this workflow where when a date is selected that option will be removed from the Table. That will use a trigger that will delete a date when it sees it after a user submission.
  22. Like
    Wikiwi got a reaction from roattw in Why wont excel properly sort timestamp?   
    From what I understand, when you convert your table to a an excel file the formatting for each column is in a "general" format. What you can do is to highlight that column in excel and change the format to date and sort it again.

  23. Thanks
    Wikiwi got a reaction from kpcollier in Document Template Generator - Using Text Area Fields with Rich Text   
    As a workaround, I think you can just use a normal text area to accept inputs. However, that will only allow your user to use "line break" by pressing the enter key.

    PDF output:

  24. Like
    Wikiwi reacted to PotatoMato in How to separate a value in a semicolon-delimited value.   
    Hi! Just to add, they can also refer to this forum post:
     
    -Potato
  25. Like
    Wikiwi reacted to NailDyanC in How to separate a value in a semicolon-delimited value.   
    Hi just to add in the previous posts above, you may check all the functions used in formula in this Caspio article: https://howto.caspio.com/function-reference/
×
×
  • Create New...