Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. Hello @BrianI, You can try the following: let dueDate = new Date('[@field:due_date]'); let today = new Date(); if(dueDate < today){ //do something } However, it is good to know the use case details, because using SQL instead of JavaScript could be possible.
  3. Hello @BrianI, It is expected that only editable fields are available https://howto.caspio.com/datapages/forms/conditional-forms/ So, I would use the following workaround. 1) Add a Virtual field, set it as a Calculated Value, and add the Yes/No field as a parameter 2) In a Rule use this Virtual field. Compare with Y or N. Y is for the checked checkbox, N is for the unchecked one. 3) Hide the Virtual 1 field after testing the DataPage.
  4. Today
  5. Hello, Just to update on this you may use a view in calculated view by adding a prefix _v_ + table name. For reference you may check: https://howto.caspio.com/datapages/reports/advanced-reporting/calculations-in-forms-and-reports/#:~:text=data from a-,View,-%2C add prefix _v_
  6. Hello, I just wanted to inform you that Caspio has released a new feature called AI Assistant. You can now utilize this feature to create a table with just a few prompts and set of instructions! For reference you may check: https://howto.caspio.com/ai-assistant/ai-assistant-overview/
  7. Hi, I have two tables tbl_clients and tbl_outcomes these tables are joined in a view and tbl_outcomes is set to be editable. There is a yes/no field in tbl_clients called tracking. I have a DataPage based on this view. I would like to control the visibility of a section on the DataPage dependant on the value in the field tracking. I am trying to use rules but I only see the fields in the editable table outcomes available to set rules on. This seems very restrictive. Am I missing something here or is that the way it is and I need to revert script to achieve this? Thanks
  8. Hi, I have a date field called duedate it is set to 3/30/2024, using the below code.... console.log([@field:due_date*]); Returns: 0.00004940711462450593 I'm not sure what this format is? It's not a timestamp I'm familiar with. I'd like to compare it to today.... var today = new Date(); if(duedate < today) How do I convert the duedate? Thanks
  9. Hi @kpcollier The code must be modified. Try the following version: <script> document.addEventListener('DataPageReady', function (event) { document.querySelector('[name="cbParamVirtual1"]').addEventListener("change", myFunction); function myFunction(event) { let calcField = event.target.value; document.querySelector('#InsertRecordBulletin').value= calcField.toLocaleString(); document.querySelector('#InsertRecordBulletin').nextElementSibling.querySelector('iframe').contentDocument.querySelector('body').innerHTML = calcField document.removeEventListener('DataPageReady', myFunction); } }); </script>
  10. Hello @khale, 1) Could you check if the values used in the script are correct? I mean the names of the employees. Do you store in the 'Case_Manager' fields values like Archie, Angela, Lorecel, etc.? These names are used in the condition. If they are not correct, the condition is never met. 2) As I can see on your screenshot, for the 'LeaveType' field the 'Continue next element on the same line' checkbox is checked. There is a comma after the field name that shows that this option is enabled. This means that a non-breaking space is added to the values of the 'LeaveType' field. For example, it is not just 'Vacation' but 'Vacation&nbsp;' This should be considered in the script. 3) On your screenshot I see the incorrect code version in the Footer. Please make sure that you copied the correct version: <script> const colorEvent = { 'Vacation': '#ff5a4b', 'Leave': '#a79beb' } const colorEmployee = { 'Glenn Mercer': '#6AA6C8', 'Archie': '#B5F5F8', 'Angela': '#F6B3A2', 'Lorecel': '#F7FEB3', 'Frances': '#7EC2BC', 'Tonie': '#60C277' } const setRelevantHeight = () => { const elems = document.querySelectorAll('.cbResultSetPanelDataContainer'); let maxHeight = 0; elems.forEach(elem => { const newHeight = elem.offsetHeight; maxHeight = newHeight > maxHeight ? newHeight : maxHeight; }) document.querySelectorAll('dl dd:nth-of-type(3)').forEach(employee => { let employeeName = employee.innerText; employee.parentElement.parentElement.style = `background-color: ${colorEmployee[employeeName]}; margin-bottom: 10px; border-radius: 10px; height: ${maxHeight + 'px'}`; }) document.querySelectorAll('dl dd:nth-of-type(4)').forEach(event => { let eventName = (event.innerText).trim(); event.style = `background-color: ${colorEvent[eventName]}; padding: 3px; border-radius: 10px;`; }) } document.addEventListener('DataPageReady', setRelevantHeight) window.addEventListener('resize', setRelevantHeight) </script> As you can see the code works on my side.
  11. Hello! You may also want to look into this page: https://www.caspio.com/live-events/how-to-create-effective-registration-forms/
  12. Hello! Just wanted to share this how-to article should you want to create a personalized email for your recipients: https://howto.caspio.com/tech-tips-and-articles/generating-personalized-email-reports/
  13. Hello! Just wanted to share this link for formulas you can use in a calculated value: https://howto.caspio.com/function-reference/
  14. Hello! I don't think that is possible yet but you can request for the feature here: https://caspio.uservoice.com/
  15. Hello! Maybe this forum post will be helpful:
  16. Hello! Just wanted to share this how-to article if you want to redirect your authenticated user depending on their roles: https://howto.caspio.com/tech-tips-and-articles/create-user-specific-redirect-after-login/
  17. Hello! I have found a forum post that you may also want to take a look into:
  18. Hello! You may also want to check out this related forum post:
  19. Yesterday
  20. @cheonsa, that's actually where I got the script I tried and listed above. I cannot get it to work. No errors, but the text area editor is still blank on load.
  21. Hi @kpcollier, I found this post that is similar to your question. I just replaced EditRecord with InsertRecord, and used the correct field names. Here's the updated script. <script> document.addEventListener('DataPageReady', function (event) { document.querySelector('[name="cbParamVirtual1"]').addEventListener("change", myFunction); function myFunction(event) { let calcField = event.target.value; document.querySelector('#InsertRecordBulletin').value= calcField.toLocaleString(); document.removeEventListener('DataPageReady', myFunction); } }); </script>
  22. @khale, the code should be added to the Footer. Please provide the screenshot of the ' Configure Fields for Calendar' page to see the possible cause of the issue. Is the 'Enable responsive' option enabled on your DataPage?
  23. Ok, I tried the code. It is not highlighting any of the type fields. Am I to put it in a html block or leave it in the footer? Yes, all fields have labels...
  24. Sorry, hit enter too soon! Yes, that is the expected result! I am trying this now! Thanks again!
  25. @khale, Is it the expected result? So, the whole cell is highlighted based on the employee name, and the type of leave is highlighted separately. I used this code: <script> const colorEvent = { 'Vacation': '#ff5a4b', 'Leave': '#a79beb' } const colorEmployee = { 'Glenn Mercer': '#6AA6C8', 'Archie': '#B5F5F8', 'Angela': '#F6B3A2', 'Lorecel': '#F7FEB3', 'Frances': '#7EC2BC', 'Tonie': '#60C277' } const setRelevantHeight = () => { const elems = document.querySelectorAll('.cbResultSetPanelDataContainer'); let maxHeight = 0; elems.forEach(elem => { const newHeight = elem.offsetHeight; maxHeight = newHeight > maxHeight ? newHeight : maxHeight; }) document.querySelectorAll('dl dd:nth-of-type(3)').forEach(employee => { let employeeName = employee.innerHTML; employee.parentElement.parentElement.style = `background-color: ${colorEmployee[employeeName]}; margin-bottom: 10px; border-radius: 10px; height: ${maxHeight + 'px'}`; }) document.querySelectorAll('dl dd:nth-of-type(4)').forEach(event => { let eventName = event.innerHTML; event.style = `background-color: ${colorEvent[eventName]}; padding: 3px; border-radius: 10px;`; }) } document.addEventListener('DataPageReady', setRelevantHeight) window.addEventListener('resize', setRelevantHeight) </script> It should work fine with highlighting the type of leave if you have a label for this field. If there is no label I need to check the options further.
  1. Load more activity
×
×
  • Create New...