Jump to content


Caspio Guru
  • Content Count

  • Joined

  • Last visited

  • Days Won


Posts posted by WatashiwaJin

  1. 17 hours ago, NeoInJS said:

    Thank @WatashiwaJin. However, I would still like my users to be able to change the field. I want to see that field populated with the First day of the month when the DataPage loads.

    Hi @NeoInJS -- if that is the case then I suggest that you follow these steps:

    - Add a "Virtual field" that uses "Calculated value" as the form element and paste the formula:

    CONVERT(DATETIME, (CAST(Month(SysUTCDateTime()) AS VARCHAR) + "/01/" + CAST(Year(SysUTCDateTime()) AS VARCHAR)), 101)

    - You can also hide the Virtual field -> go to the advance option then check "Hide Field:

    - Now, we are going to create a script that will get the value form the formula. For us to do that we need to add a "Header and Footer" -> then in the footer paste this code:

    <script type="text/javascript">
    document.addEventListener('DataPageReady', function (event) {
      var vrt = document.querySelector('[name*=cbParamVirtual1]');
      var date = document.querySelector('[name*=InsertRecordYOURDATEFIELD]');
      vrt.onchange = function() {
      date.value = this.value.substring(0,9);

    - Make sure that you unchecked the "Enable HTML Editor" in the advance tab of the Footer.

    - After this process, your date field will get the first day of the month and it still can be editable :)


    For more details, check these article:



    I hope this helps :) 


  2. Hi @FinTheHuman,

    If you want the result to be editable then you will need a custom script to do that, follow this process for the step:

    (1) Use a Virtual field to do the calculations of the formula provided earlier and insert a DATETIME field(to store the output of the formula)

    (2) then make the Virtual field hidden :


    (3) Insert a Header & Footer -> and paste this code in the Footer part:

    <script type="text/javascript">
    document.addEventListener('DataPageReady', function (event) {
      var src = document.querySelector('[name*=cbParamVirtual1]');
      var dest = document.querySelector('[name*=InsertRecordDATE]');
      src.onchange = function() {
      dest.value = this.value.substring(0,9);

    Important Note:

    - Make sure that you unchecked the "Enable HTML editor" in the advance option of the Footer.

    - Use the correct name value of your actual field in the script.

    - The "var src" is the SOURCE of the value(where the formula is located).

    - The "var dest" is the DESTINATION of the formula output (the editable Date field itself).

    - This process is working on my end. Feel free to test it out here: https://c1abv183.caspio.com/dp/482760009312d3d82a8949d4987e


    I hope this helps :) 


  3. Hi @FinTheHuman,

    You can add new Virtual field and use "Calculated value" in the form element then paste this formula to get the next day excluding the weekend:

    WHEN ((DatePart(dw, GetUTCDate())) = 6)
    THEN (DateAdd(day, 3, GetUTCDate()))
    WHEN ((DatePart(dw, GetUTCDate())) = 7)
    THEN (DateAdd(day, 2, GetUTCDate()))
    ELSE (DateAdd(day, 1, GetUTCDate()))

    I hope this helps :)


  4. Hi @SteveT,

    As far as I understand, you want to have second/another search within the primary search. Basically, search again after in the filtered result.

    If that is what you want then I suggest that you follow these process:

     (1) Create a Submission form with Virtual field(s) *for your first search/filter -> check "OnExit" in the advance option and change the parameter name ->  then paste the next URL (the search and report DataPage):


    (2) Create a Search and Report DataPage then in the configuration of search field(s), received the parameter that is being passed.  Then follow the 2 scenarios below:

    Case 1 (Search with a different field):

    If the first search is to filter the initial result then you will do search again with a different field then do this process:



    Case 2 (Search with the same field):

    If you will also search with the same field to get a result then do this process:



    Let me know if you have further questions.

    I hope this helps :) 



  5. Hi @FinTheHuman - In addition for the earlier response, you can also use this formula to get the week number with the corresponding month via DataPage level:

    (DatePart(day, DateDiff(day, 0, [@field:DATE])/7 * 7)/7 + 1) = 1
    THEN 'Week 1 of ' + (DATENAME(month, [@field:DATE]))
    (DatePart(day, DateDiff(day, 0, [@field:DATE])/7 * 7)/7 + 1) = 2
    THEN 'Week 2 of ' + (DATENAME(month, [@field:DATE]))
    (DatePart(day, DateDiff(day, 0, [@field:DATE])/7 * 7)/7 + 1) = 3
    THEN 'Week 3 of ' + (DATENAME(month, [@field:DATE]))
    (DatePart(day, DateDiff(day, 0, [@field:DATE])/7 * 7)/7 + 1) = 4
    THEN 'Week 4 of ' + (DATENAME(month, [@field:DATE]))
    ELSE 'Week 5 of ' + (DATENAME(month, [@field:DATE]))


  • Create New...