Jump to content

DrSimi

Caspio Ninja
  • Posts

    36
  • Joined

  • Last visited

  • Days Won

    5

DrSimi last won the day on July 27

DrSimi had the most liked content!

2 Followers

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

DrSimi's Achievements

  1. Hi @Connonymous, Can you try using IN instead of '='? SELECT TOP 1 Pay_Plan FROM JFM_Plan_Type WHERE Pay_Plan_ID IN ( SELECT Pay_Plan_ID FROM JFM_Grade_Order_List WHERE Org_ID = target.[@field:JFM_Job_Description_Org_ID] AND ( ( target.[@field:JFM_Job_Description_Department] <> 'Various' AND Class_ID = target.[@field:JFM_Job_Description_Class_ID] ) OR ( target.[@field:JFM_Job_Description_Department] IN('Various','Multiple','') AND Recommended_Class = target.[@field:JFM_Job_Description_Class_Title] ) ) )
  2. Hi @wimtracking2, Do you need to do the download in the same DataPage? You can have one version before payment without the download enabled, and one version after the user already paid. These are my suggestions: -Since you seem to be using Listboxes for the search, building the SQL formula to get the count of results from those search parameters like @Volomeister suggests may be complex, but is still doable. Another option is to get the Total Count of records returned from the record count text at the bottom of the tabular report. See: -Use the option to limit how many records are returned per page so you give a "preview" of the result set to the user. -Do not enable Download options in this DataPage. -Use JS to remove the page navigation controls completely from the DOM, using this inside DPReady event (I haven't tested this fully): document.querySelector('.cbNavBarCtnt').remove() -Add the Download as a custom button or link, which would take the user to the Payment DataPage first. The Total Count has to be passed as a parameter from the button link. -After payment, the user would be taken to another version of the DataPage where you do not remove navigation controls and have the Download option enabled. Hope this helps!
  3. Hi @besoss, I don't think the WP Caspio plugin is maintained or required anymore. Have you tried simply adding the Deploy Embed script to an HTML Block in your wordpress page? See Custom HTML Block . Wordpress does have some known behavior where CSS from the website it can interfere with the CSS loaded from Caspio, but this also depends on the site theme you are using. CSS can always be customized in Caspio as well if something doesn't work properly. I haven't found any limitation with regards to conditional logic; if it works in the Caspio URL it should work in your website too, assuming there isn't conflicting code.
  4. Hi @SpedTeam, I came across a similar requirement not too long ago and it turns out the solution is quite simple, but does require manually building and maintaining your HTML table. Here's what I did: 1) Add an empty Table with the Headers in the Footer of the DataPage. The amount or text of the columns can be customized as needed, but should ideally match the same columns you are showing when there are Results returned in the report. <table class="cbResultSetTable cbResultSetTableCellspacing cbReportSpa" data-cb-name="cbTable" id="cbTable_noResults" style="display:none;" title="Data table"> <thead> <tr class="cbResultSetTableHeader" data-cb-name="header"> <th class="cbResultSetLabel cbResultSetHeaderCell"></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Ticket</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Account ID</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Customer Name</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">City</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Country</a></th> <th class="cbResultSetLabel cbResultSetHeaderCellNumberDate" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Reported Date</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Ticket Status</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">SLA</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Company</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell"><span>&nbsp;</span></th> </tr> </thead> </table> If you want the "No records found" text displayed as the first row of the empty table, you can add it manually too. Adjust the colspan value depending on the number of columns you have: <table class="cbResultSetTable cbResultSetTableCellspacing cbReportSpa" data-cb-name="cbTable" id="cbTable_noResults" style="display:none;" title="Data table"> <thead> <tr class="cbResultSetTableHeader" data-cb-name="header"> <th class="cbResultSetLabel cbResultSetHeaderCell"></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Ticket</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Account ID</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Customer Name</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">City</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Country</a></th> <th class="cbResultSetLabel cbResultSetHeaderCellNumberDate" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Reported Date</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Ticket Status</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">SLA</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell" scope="col"><a class="cbResultSetLabelLink" href="unsafe:void(0);">Company</a></th> <th class="cbResultSetLabel cbResultSetHeaderCell"><span>&nbsp;</span></th> </tr> </thead> <tbody> <tr> <td colspan="10" style="color:red; text-align:center; padding:10px">No records found.</td> </tr> </tbody> </table> 2) In the Localization for the DataPage, add this script as the Custom Text. It will display the Table in the footer only when there are no Results: <script>document.querySelector('#cbTable_noResults').style.display="block";</script> Hope this helps!
  5. Hi, I wanted to share a solution I found after finding out that Caspio's default Responsive behavior for Mobile is to show a "Search" button on Mobile instead of the Search fields. Sometimes, this is not great as the Search may just contain one simple field, so it just adds unnecessary clicks for the user. <style> section[class^="cbFormSection"][class*="cbSearchSpa"] div[class*="cbSearchButtonContainerM"] { display: none !important; } section[class^="cbFormSection"][class*="cbSearchSpa"] div:has(select) { display:block !important; } </style> Modify the div:has... piece in the selector to match any of your fields in the SEARCH form to avoid displaying something you don't want. The code above matches a search form that has a dropdown (select) element on it.
  6. Hi @Golden, Maybe I didn't understand your use case very well, but from what I gathered is that you have multiple fields used to filter a Report, and not all of the values in them may come from the Datasource of the DataPage. Are the values present in the datasource though? Or will you use the values selected as 'parameters' for other Calculated Fields? Anyways, I think you can set your filtering field to be Dropdown form element, and choose Source->Lookup Table/View or "Both" as the Datasource. If you need to also be able to run SQL queries or even configure Cascading elements in the Search fields, I believe separating the Search and Results into two DataPages is the way to go. Check this out Separating Search Page and Results Page into Two Different Web Pages. If you want to use the values selected as parameters you can simply enable "pass value as parameter on exit" option under the Advanced tab, and use that parameter inside your Calculated Field. The value will be passed when they click Search. See Passing Parameters through Caspio.
  7. Hi everyone, I wanted to share a method to have a floating navigation menu or sidebar menu that is pretty much copied over from this great article: Poppin' In | CSS-Tricks As you can see, this makes use of a pretty newly supported element attribute: popover. To create your nav menu, simply create an App Parameter as Long Text, and paste the code below. Do not forget to modify the <li> and <a> elements at the bottom with your desired text and links. Then, you can use this App Parameter in the Header of your DataPages as needed. Note I just converted SCSS from the last codepen in the article to pure CSS and made minor adjustments like changing the background color: <style> @import "https://unpkg.com/open-props"; .page-wrap { transition: translate 0.5s; } header { display: flex; justify-content: end; } .menu-trigger { background: #0000008a; border: 1px solid currentcolor; border-radius: 8px; color: #fff; display: flex; gap: 1rem; padding: 0.5rem 1rem; place-items: center; text-decoration: none; transition: background 0.25s filter 0.25s; } .menu-trigger svg { fill: #fff; max-inline-size: 30px; } .menu-trigger:has(:hover, :focus-visible) { background: #000; filter: brightness(50%); } #flyout { background-color: var(--gray-0); box-shadow: var(--shadow-6); height: 100vh; position: fixed; inset: unset; top: 0; left: 100%; translate: 0; transition: translate 5s ease-in; width: 250px; z-index: 2; } nav[popover] ul { display: flex; flex-direction: column; line-height: 1; list-style: ""; margin: 0; padding: 0; } nav[popover] ul li { display: flex; flex: 1; margin: 0; padding: 1rem 0; transition: background 0.25s; } nav[popover] ul li a { color: var(--orange-8); margin-inline-start: 5px; text-decoration: none; text-transform: uppercase; transition: translate 0.25s; } nav[popover] ul li a:is(:hover, :focus) { color: #fff; translate: 1ch 0; } nav[popover] ul li:not(:last-of-type) { border-block-end: 1px solid var(--orange-8); } nav[popover] ul li:has(:hover, :focus-visible) { background: var(--orange-10); } body:has(#flyout:popover-open) .page-wrap { translate: -250px 0; } [popover] { overflow: hidden; } #flyout:popover-open { animation: slide 0.5s forwards; border: 0; opacity: 1; } #flyout::backdrop { background: rgba(38, 38, 38, 0.5); backdrop-filter: blur(8px); transition: opacity 0.5s, display 0.5s, overlay 0.5s; } @keyframes slide { to { translate: -250px; } } </style> <button popovertarget="flyout" class="menu-trigger" href="#"> <svg viewBox="0 0 448 512" width="100" title="bars"> <path d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z" /> </svg> <span>Menu</span> </button> <nav popover id="flyout"> <ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Blog</a></li> <li><a href="#">Contact</a></li> </ul> </nav> Hope this helps someone!
  8. Hi @Mauricia, I don't have any issues with the signatures displaying in the HTML Block or in the PDF Download from a Tabular Report, so it may be something on your configuration. Can you share an export of your DataPage with test data to check it out? Are you using authentication?
  9. Hi, I just wanted to share a couple of notes here, it is possible to implement RANK, ROW_NUMBER and DENSE_RANK functions in Triggered Actions or Tasks without the actual function since it is not available. See this Stackoverflow post: https://stackoverflow.com/a/46856508 Db Fiddle if you want to play around with pure SQL: https://dbfiddle.uk/wrHuSG5a RANK in Task: DENSE_RANK in Task:
  10. @BrianI, An alternative I can think of is creating a Separate search and Report. Separating Search Page and Results Page into Two Different Web Pages. In the Search DataPage, use a Calculated Value and write a SQL formula with the criteria that will output IDs with " OR " between each value, i.e. "A OR B OR F OR H OR Z"... You will have to set the receiving filter in the Report DataPage to "Contains", see Passing Multiple Values in One Parameter. I am not sure if this will work with many results output from the formula though, but I think it should.
  11. Hi @BrianI, @NiceDuck's suggestion is the closest to your needs, but the filter has to be in the "JOIN" for it to work, not in the WHERE. Since we cannot add hardcoded/static values in the View JOINs in Caspio, you can add a Formula field to your Staff Table with the "type" (X) value you want to use to filter hardcoded. For example, here's my users table: Then when creating the View, use this to filter as well as the ID: This does yield the expected result of NOT showing UserID 1 and 3 in the View since they already have a record with 'Type_2'. The downside here is that the field will have to live in your Staff Table and you would have to create other fields if you have to present different reports. Another alternative is using pure SQL in Report DataPages for real-time visualization. The view above would translate into: SELECT TOP 1 A.UserID FROM USERLOGIN_TEST_1_1_test A LEFT JOIN A_LeftJoinTest B on B.UserID = A.UserID AND B.Type = 'Type_2' WHERE B.UserID IS NULL Though it only includes 1 result. To present multiple values in the DataPage, you can see this post: Hope this helps!
  12. Hi - Just another addition to this using the great syntax suggested by @Kurumi, if you ever need to do something with each word in a text field or string, you can use the following: CASE WHEN LEN('[@field:YourTextField]')>0 THEN STUFF((SELECT ' '+ UPPER(LEFT(value,1))+LOWER(SUBSTRING(value,2,LEN(value))) FROM STRING_SPLIT('[@field:YourTextField]',' ') FOR XML PATH ('')), 1, 1, '') ELSE NULL END In the above, the STRING_SPLIT function is used to separate each word in a string (using space (' ') as the separator) in separate rows instead of Selecting multiple rows from a Table. Once we have each word in a row, Upper/Lower/Substring functions are used to capitalize only the first letter. Then we "merge" every row back into one with the STUFF/FOR XML PATH functions. The CASE/WHEN was added because for some reason, if the field is blank the formula would output the whitespace hex code in a Calculated Value/Field. Input text: 'hi, this is a test' Result: 'Hi, This Is A Test' See this article STRING_SPLIT (Transact-SQL) - SQL Server for reference and an example. Hope this helps someone!
  13. Hi @StephanieW, The request sounds doable with all of Caspio's PDF generation methods, be that a fillable PDF where you set the "markers" mapped to each field in a datasource (and a predefined format for the document), or you could even create a Details Page with the Download PDF option enabled and create the format you're looking for using HTML Blocks. https://howto.caspio.com/datapages/datapage-components/html-blocks/ https://howto.caspio.com/parameters/formatting-parameters-in-email-body-and-html-blocks/ On the other hand, if you format your letter with HTML, you can also enable the Email Notifications in a DataPage or create a Triggered Action/Task with a Send Email block that would send them this information formatted automatically (though not in PDF format) on a predefined schedule or when a Table action happens, for example. https://howto.caspio.com/notifications/email-notifications/configuring-email/ https://howto.caspio.com/triggered-actions/triggered-action-elements/actions-2/send-email/ I hope this helps!
  14. Hi @DavidBRX, Have you reviewed the Time Zone settings in your account, and/or in the Localization used in the DataPage?
  15. Hi Lynda, I am not familiar with the Canvas element with JS and HTML, but it has been an interesting read. While I am not sure why the class you provided isn't working fine, it looks like the class expected in the selector inside the HTML block and the class being created are different. In addition, it may be simpler to add a wrapper for the canvas and then just select it when calling the class. In any case, I stumbled upon this SO post which has a very neat example for a gauge style chart which may fit your use case. The value provided to it is at the bottom where the Chart is created. It uses this library https://github.com/kluverua/Chartjs-tsgauge . https://stackoverflow.com/a/58932841 Hope this helps.
×
×
  • Create New...