Jump to content

CoopperBackpack

Caspio Guru
  • Content Count

    128
  • Joined

  • Last visited

  • Days Won

    23

Reputation Activity

  1. Thanks
    CoopperBackpack got a reaction from wimtracking2 in Preselect multiple values to search in multi-select dropdown list   
    Hello @wimtracking2,
    As I understood from your inquiry, you store the cities in the field with the Text(255) data type and set this field on the Search page as Listbox -> Allow multiselection

     
    And the Search is set like this:

     
    If this is the case, it is possible to add the "selected" attribute to the options you want by JavaScript. 
    I added this code to the Footer section on the "Search and Report Wizard - Configure Search Fields" page (the HTML editor is disabled on the Advanced tab before pasting). 
    <script> document.addEventListener('DataPageReady', selectedOptionHandler) function selectedOptionHandler() { let firstCity = document.querySelector('#Value1_1 > option[value="Bozeman"]'); let secondCity = document.querySelector('#Value1_1 > option[value="Belgrade"]'); let thirdCity= document.querySelector('#Value1_1 > option[value="Livingston"]'); firstCity.selected = secondCity.selected = thirdCity.selected = true; document.removeEventListener('DataPageReady', selectedOptionHandler); }; </script> And here is the output. So, I can see the list of records where City is Bozeman, Belgrade, or Livingston on initial load.

     
    In the example, the City field on the Search page is the only field and has the id Value1_1 that is used in the code above.
    Basically, the second field on the Search has the id Value2_1, the third field - Value3_1, etc. Please replace the id in the code if needed. 
    Hope this is the expected result and this solution helps.
  2. Thanks
    CoopperBackpack got a reaction from Hiperf in Custom script changing field value   
    Hello @Hiperf,
    The issue can be connected to the exact field name. As far as I understand, the formula is in the Calculated Value field is valid. This means that the field name is PropertyActive (not _PropertyActive).
    In this case you need to reference the field as EditRecordPropertyActive (without underscore before the field name). I used underscore because it was in the initial script. 
    You may learn more in this post https://forums.caspio.com/topic/4377-js-guide-caspio-form-elements/
    Please test the code with this small correction. I tested this solution in my account ant it works as expected for me. 
     
  3. Like
    CoopperBackpack got a reaction from Mollie in I want my site to be displayed correctly on the phone.   
    Hello @Mollie,
    If you are referring to the Caspio DataPages, please use the Responsive option.
    You may learn more in these articles:  https://howto.caspio.com/datapages/responsive-datapages/responsive-datapages/
  4. Like
    CoopperBackpack got a reaction from Stepford in How can I get numbers to align to the right?   
    Hello @Stepford,
    You may select one of the two approaches:
    1) Change the alignment in the Styles section. In this case, the changes will be applied to all DataPages that use this Style.
    Please open the Source tab -> All -> find the cbResultSetTableCellNumberDate CSS class using Ctrl-F (or Command-F for Mac) -> change the text-align to right.

     
    2) You may apply the changes to the particular DataPage without changing the Style.
    To do this you may add Header/Footer elements on the Configure Results Page Fields page and paste the code to the Header.
    Disable the HTML Editor on the Advanced tab before pasting the code.
    <style> .cbResultSetTableCellNumberDate { text-align: right !important; } </style>
     
    Please note that this CSS class (cbResultSetTableCellNumberDate ) have fields with the following data types in the table: Autonumber, Number, Integer, Currency, Date/Time, Timestamp, Formula (if stores numeric  values). 
    Try the apply the changes and update this thread if you have further questions. 
  5. Thanks
    CoopperBackpack got a reaction from Eugene in Spacing on 3D Pie Chart   
    Hello @Eugene,
    Since Caspio uses the Highcharts library to render Chart DataPages, I have checked the Highcharts documentation https://api.highcharts.com/highcharts/ 
    I was able to find the solution that allows to add spaces between slices for the usual Pie Chart (not 3D Pie Chart).
     
    You may paste this code to the Footer section on the  "Chart Wizard - Configure Chart Options" screen of your DataPage. 
    Do not forget to disable the HTML editor on the Advanced tab before pasting the code.
    I put the borderWidth as 3, please use the value that you need.
    < script > document.addEventListener('DataPageReady', chartUpdateHandler) function chartUpdateHandler(event) { var cleaner = function (interv) { clearInterval(interv); } let interv = setInterval(() => { var chart = Highcharts.charts[0]; if (!chart) return; chart.update({ plotOptions: { pie: { borderWidth: 3 } } }); cleaner(interv); }, 200); } </script>  
    Here is the result:

     
    Maybe this information is helpful for you. Unfortunately, I could not find the property that allows adding the space between slices for the 3D Pie Chart.
    Regards,
     
  6. Like
    CoopperBackpack got a reaction from ParkLoey in IF/THEN in Report   
    Hello @jeffs88keys,
    It looks like the solution depends on the exact DataPage type. Could you let me know if this is a Tabular Report DataPage or Details DataPage?
    Do you need to display the statement in each record  if this is a Tabular Report DataPage like this? 
     

    If so, please double-check the condition, since I am afraid it your question it is "when  [field1] is blank or if [field2] is blank" for both cases.
    Also, specify the the data type for [field1], for [field2] it is File data type as I understand. 
  7. Like
    CoopperBackpack got a reaction from Gabrielle in Tables from Current Project Don't Show Up When I Try to Create an Authentication Object   
    Hello @Gabrielle,
    Please note that this dropdown shows the tables that have a unique field.
    The Authentication can be created using the table with the unique field since it`s required to define the specific user.  
    For example, in this table the email field is set to unique:

    Feel free to update this thread in case of additional questions. 
  8. Like
    CoopperBackpack got a reaction from imJihyo in Tables from Current Project Don't Show Up When I Try to Create an Authentication Object   
    Hello @Gabrielle,
    Please note that this dropdown shows the tables that have a unique field.
    The Authentication can be created using the table with the unique field since it`s required to define the specific user.  
    For example, in this table the email field is set to unique:

    Feel free to update this thread in case of additional questions. 
  9. Thanks
    CoopperBackpack got a reaction from Valik in API Get with multiple parts   
    Hello @Pingzinggolf,
    In case you want to get all fields that meet the criteria Lead_Source='a" and Email = 'b' (just example), please use AND logic operator.
    Please see a screenshot:


    If the Lead_Source and Email fields have Text(255) data type, use single quotes to wrap the values as shown on the screenshot.
    Hope this helps.
  10. Like
    CoopperBackpack reacted to jeffs88keys in Passing from Datapage Report   
    This worked perfectly.  Thank you so much for your time to help me. 
  11. Thanks
    CoopperBackpack got a reaction from awolagain in Free account   
    Hello @awolagain,
    You may refer to this article https://howto.caspio.com/tech-tips-and-articles/common-customizations/create-user-specific-redirect-after-login/
    This solution is relevant in case you need to redirect users to deferent web-pages depending on their roles. 
    If all users have the same role,  you may skip this step and not create the HTML page with JavaScript code for redirection the users.
    Hope this helps. 
  12. Thanks
    CoopperBackpack got a reaction from awolagain in Free account   
    Hello again @awolagain,
    1) If you are referring to the demo application in your account as shown on the screenshot below, this demo is attached by default to showcase the application in Caspio account, etc.
    You may even delete it. This is up to you.

    2) If you are asking about Trial and Free accounts, these are two different plans.
    As far as I know the Trial account is valid for 14 days and has features that are similar to the paid Grow plan. So each user of  the Trial account can review most of the available features.
    Free account  is limited in features, but not limited in time. You may check the Pricing page https://www.caspio.com/pricing/ 
    For example, there are only 25 DataPages in the Free plan, and only 5 of them can have the enabled deployment status. 
    In case you have the Trial account now, you may convert it to a Free or Paid plan before the Trial period ends. Please check how the plan can be changed https://howto.caspio.com/managing-your-account/changing-your-plan/
    Feel free to update this thread if you have any further questions. 
  13. Like
    CoopperBackpack reacted to FaeFaeFae in Task to pull most recent entry for each device if last entry was 1+ month ago   
    Hey, @Fleshzombie!
    I wanted to add to the above solution. Below is a bit more effective way to sort the data by using HAVING instead of outer SELECT block. The solution above is good and it will work when inserting into a table, however when using a table variable with the query, you may encounter "Operand type clash" error.
    Try this:

     
  14. Thanks
    CoopperBackpack got a reaction from sandy159 in How to remove duplicate characters from a string   
    Just sharing the solution in the Question&Answer way. Maybe it is helpful for some forum members.
    This formula helped to remove extra commas from the string:
    REPLACE(LTRIM(RTRIM(REPLACE(REPLACE(REPLACE(REPLACE(([@field:field_1] + ',' + [@field:field_2] + ',' + [@field:field_3] + ',' + [@field:field_4] + ',' + [@field:field_5]), ',', '><'), '<>', ''), '><', ','), ',', ' '))), ' ', ',')
    The output is the following (Formula_1 field):

     
  15. Thanks
    CoopperBackpack got a reaction from NickO in Triggered action to send email issues   
    Hello @NickO,
    I believe you may use another approach for this Trigger. It is better to avoid using the If-Then block when you can use the Select statement instead. 
    Could you test the Trigger design like this?

    So, you may add the Select statement by clicking the Gear icon and select the record from the #inserted table that met the criteria.
    If the criteria are met the email for a group of users is send. 
    Feel free to update this thread in case you have additional questions. 
  16. Thanks
    CoopperBackpack got a reaction from imJihyo in Adding a Form to a Result Page   
    Hello @DougH,
    The easiest way to implement this is the following:
    1) Add the HTML block on the  Configure Results Page Fields screen of your Report DataPage.
    2) In the HTML block place a link to your Submission form DataPage and pass the event ID as a parameter.
    For example:
    <a href="https://c1aaa111.caspio.com/dp/9fae7000db8d9f6958d84c15b418?Event_ID=[@field:Event_ID#]">Register for this event</a>

    3) On the Submission form DataPage receive the Event_ID parameter.

     
    Please replace the [@Event_ID] with you local field name. 
    Hope this helps. 
     
     
  17. Like
    CoopperBackpack got a reaction from kpcollier in Number of Fields Dependent On Value   
    Hello @kpcollier,
    If I got your inquiry correctly then you need to have a dynamic dropdown based on another dropdown. 
    This requires a rather bulky JS solution as I understand. 
    Did you consider using a Cascading dropdown on the DataPage? 
    You just need to have a well-structured lookup table (please refer to this example on the screenshot)

    So, the first field is dropdown and the second one is the Cascading dropdown (https://howto.caspio.com/datapages/datapage-components/cascading-elements/)

     
    Is this solution right for you?
  18. Thanks
    CoopperBackpack got a reaction from David17 in Editing user entered numbers in a webform   
    Hi @David17,
    I am glad that solution works for you now.
    If you need to add this code for several fields, please use this code
    <script> document.addEventListener('DataPageReady', checkInput); function checkInput(){ let numberFirst = document.getElementById('InsertRecordField_1_name'); //declare first variable let numberSecond = document.getElementById('InsertRecordField_2_name'); //declare second variable numberFirst.min = "0"; numberSecond.min = "0"; numberFirst.type = "number"; numberSecond.type = "number"; numberFirst.setAttribute("oninput", "validity.valid || (value='')"); numberSecond.setAttribute("oninput", "validity.valid || (value='')"); } </script> So, we save the input fields to the variables.
    And in the code below we add attributes to this variables. 
  19. Like
    CoopperBackpack reacted to sandy159 in All the Aggregate fileds in one row   
    Hello @VincenzoCocciolo,
    If you would like to perform the same aggregate function on multiple field columns, you can add multiple fields to one aggregation, and the results will automatically appear in one row but in the appropriate column. Otherwise, if you need different calculations for each column, you must use multiple aggregate fields and it will appear in different rows.
    Please refer to the Totals and Aggregations article.
    Also, you may look into the Pivot instead of the Tabular Report DataPage. I found the forum post with a similar issue that may help you:
    Feel free to update this thread if you have further questions.
    Regards
  20. Like
    CoopperBackpack got a reaction from TeamVilla in Different types of Caspio tables   
    Hello @TeamVilla,
    It looks like the Master/Detail tables are  equal to Parent/Child tables. 
    A Parent table is the table that stores the primary key (a field that uniquely identifies the table records).
     A Child table is the table that references the parent with a foreign key. 
    Here is the article https://howto.caspio.com/tables-and-views/relationships/database-relationships/
    I believe, that Domain table is equal to Lookup table (Countries_table, Months_of_the_Year_table, etc. ). It stores data you've pulled out of your table to make the table smaller. You may set the relationship between the Lookup table and other tables by the use of foreign keys.
    You may want to check this article https://howto.caspio.com/tables-and-views/lookup-tables/
    Hope this helps. 
  21. Like
    CoopperBackpack got a reaction from kpcollier in Custom Autonumber, auto increment   
    Hello @kpcollier
    I am afraid that this cannot be achieved with Formula field in the table, since Formula field operates only within 1 record.
    As a result, we cannot check/use the values that are stored in the other records in the Formula field.
    It looks like the best solution is to create a Triggered Action.
    I am not sure about your table design, so I assume that Est_Table is the child table that has the Bid_id field as well.
    For example, the table looks like this:
     

     
    This is the Trigger design:

     
    Here is the output:

     
    Maybe it is possible to optimize the Trigger or use another approach. 
    Feel free to update this thread if you have any questions. 
  22. Thanks
    CoopperBackpack got a reaction from nanglin in Need to block user from submitting a registration form if their email domain does not contain certain words   
    Hello @nanglin,
    I see. Since  there is the code to submit the form in the "else if" condition, once the Submit button is clicked, 2 records are submitted.
    As I understand, the email field is unique in the table, so you see the message regarding the duplicates.
    Please remove the else if condition and test the DataPage.
    <script> document.addEventListener('BeforeFormSubmit', function(event) { let checkValue = document.querySelector("[id*='cbParamVirtual2']").value; if (checkValue == '0') { event.preventDefault(); alert("Your domain is incorrect, contact your system administrator"); } }) </script>  
  23. Like
    CoopperBackpack reacted to nanglin in Need to block user from submitting a registration form if their email domain does not contain certain words   
    This solution worked @CooperBackpack Thank you!!!!!
  24. Thanks
    CoopperBackpack got a reaction from nanglin in Need to block user from submitting a registration form if their email domain does not contain certain words   
    Hello @nanglin,
    Please try to paste this code to the Footer section of the Submission form. 
    Disable HTML editor before pasting.
    <script> document.addEventListener('BeforeFormSubmit', function(event) { let checkValue = document.querySelector("#InsertRecordfield_name").value; //replace the field_name with your local field name if (!checkValue.includes('@123.com')) { event.preventDefault(); alert("Your domain is incorrect, contact your system administrator"); } else { document.forms["caspioform"].submit(); } }) </script> Please replace the field_name and customize the alert message. 
    Hope this solution helps you. 
  25. Like
    CoopperBackpack reacted to kpcollier in Page Redirection JS Help   
    @CoopperBackpack,
    I apologize, when I added my personal field to the script, it added a "#" to the field that prevented the script from working. 
    It is now working on my side. I appreciate the help. 
×
×
  • Create New...