Now() vs now easter egg
Just thought I would pass a tip along that I recently learned from a Quick Base staffer. Whenever you use a formula URL button and are trying to populate a date time field with the current date and time on a Button click, a problem I have always run into is that the button can get stale sitting on the screen. Here was my typical partial syntax. URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#] & "&_fid_154=" & Now() But if you use this syntax, the system will stamp the date time the screen was loaded (and could be sitting there getting stale) as opposed to what you really want which is the time that the button was clicked. But this alternative partial syntax will give you the time the button was clicked regardless of how stale the screen load is.. URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#] & "&_fid_154=now" ------------------------------ Mark Shnier (YQC) Quick Base Solution Provider Your Quick Base Coach http://QuickBaseCoach.com mark.shnier@gmail.com ------------------------------34Views6likes3CommentsUsing HTML in Formula - Rich Text Fields
At EMPOWER2019 in Miami, Senior UX Designer Lisa Sawyer shared some awesome tips in her session Quick DIY solutions for beautiful & user friendly apps. Do yourself a favor and carve out an hour to check out this highly informative session. If you only have a few minutes to spare, check out this quick video highlighting my favorite tip: using HTML in Rich Text Formula Fields This is a great technique to quickly add some color and style app by highlighting key data points or KPI’s for your end users. Here is the code snippet that is used in the video: "<div style=\"color:#74489D;font-size:350%;font-weight:bold;\"align=\"center\">"& ADD YOUR FIELD &"</div>"& "<div style=\"color:#gray;font-size:150%;font-weight:bold;\"align=\"center\">PLACEHOLDER TEXT</div>" To learn more about which HTML Tags are allowed by Quick Base, click here ------------------------------ Freddie Sabbs fsabbs@quickbase.com ------------------------------379Views4likes3CommentsHow best can I obfuscate/encrypt URL query parameters that are passed to a code page on our database?
Hi all! I was asked to develop an app that can present records associated with a particular user in a printable 8.5x11" worksheet-style form. As of now, I accomplish this with a URL button field that links to a code page with a "?userEmail=abcde@email.com" tacked onto the end. My javascript code takes the email from the URL, inserts it into an API_DoQuery, and uses the results to populate the worksheet. My question is: what's the best way I can keep a user from changing the URL to see somebody else's records? My initial thought was to change the URL parameter and base64 encode the email to get something more like "?x=YWJjZGVAZW1haWwuY29t" which is probably obfuscated enough considering that most of the users wouldn't be savvy or interested enough to figure out how to look at other people's records. Honestly none of the records contain terribly sensitive information. Simple base64 obfuscation would probably serve fine. But maybe one of you has a more secure method of accomplishing this outcome! Maybe using an application variable as a key? I don't know but I'm interested in finding out. Thanks in advance for the help!65Views3likes0CommentsMagic Buttons to Collapse/Expand Sections & Scroll to Top
This post describes how to build a set of three buttons that aid navigation of long forms. When a form has many sections and fields, one solution is to use Tabs. However, if there are several sections within a Tab, users may still have to do a lot of scrolling and clicking. The idea proposed here is to create a set of three buttons that float, always visible, at the bottom of the form: [Back to Top] [Collapse] [Expand] [Back to Top] simply scrolls to a standard location near the top of any page (#navTop). While Quick Base has a handy icon to scroll to the top, it's placed near the top. Normally you want to do this when you are near the bottom, so it's handy to have a button located there. [Collapse] and [Expand] use fairly simple JavaScript to collapse or expand all sections. The versions described here are compatible with Tabs in the following sense. They only collapse or expand within the current Tab. With these buttons, a user who knows the structure and contents of a long form can collapse them all, then scan the section-headers to open just the one section they need. Or, they can set a preference by collapsing all, then clicking on their favorite sections to expand them, and leaving the form that way each time they exit. Of course, there's always the option to open up all the sections, if the user really likes to scroll. In short, the three magic buttons accommodate the preferences of just about any user. Step 1. Create a formula-text field called "Bottom Nav" for the three buttons. The field's checkboxes must have "Allow some HTML ..." checked and should have the "Reportable" and "Searchable" boxes unchecked. For the formula, insert this: var text buttonStyle=" class='Vibrant' style='padding:3px; white-space:nowrap; vertical-align:middle; line-height:21px;'"; var text imageStyle=" style='vertical-align:middle; background-color:white;'"; "<span style='font-size:120%; font-weight:bold; position:fixed; bottom:20px; left:44px; z-index:1000;'>" & "<a href='#navTop'" & $buttonStyle & ">" & "<img class='TblIcon20 Upload' " & $imageStyle & ">" & " Back to Top</a>" & "<a href=\"javascript:" & [Collapse Sections] & "void(0);\"" & $buttonStyle &">" & "<img class='TblIcon20 Animation' " & $imageStyle & ">" & " Collapse</a>" & "<a href=\"javascript:" & [Expand Sections] & "void(0);\"" & $buttonStyle &">" & "<img class='TblIcon20 OSI_Model' " & $imageStyle & ">" & " Expand</a>" & "</span>" Some explanation ... The buttonStyle and imageStyle variables set the size and style of the buttons to be reasonably compatible with Quick Base standards. The <span> is set to be positioned at the bottom, with a z-index that floats it above all other elements of the page, left-aligned so as to obscure data-entry fields and thus prevent mis-clicks. As shown here, all three buttons use one of the standard images that Quick Base supplies as table-icons. You may prefer to use other images, or skip the images and just use plain text for the buttons. Finally, the [Collapse] and [Expand] buttons require some JavaScript. That's the next step. Step 2. Create two global variables, in the Variables section of Settings for your app. "Collapse Sections" is the name you should give to a text variable that contains the following: $('.sectionTitle').each(function(){ var $titleWrap = $(this).parent(); var $expandedTitle = $titleWrap.hasClass('expanded') && (this.innerHTML.length > 0); var $tabWrap = $titleWrap.parent().parent(); var $hiddenTab = $tabWrap.hasClass('ui-tabs-hide'); if($expandedTitle && !$hiddenTab){ this.click(); } }); $('#backToTop').click(); In words, this script finds every expanded section within the current tab, clicks each of those section-headers to make the section collapse, then scrolls up. "Expand Sections" is the name you should give to a second text variable that contains the following: $('.sectionTitle').each(function(){ var $titleWrap = $(this).parent(); var $collapsedTitle = $titleWrap.hasClass('collapsed') && (this.innerHTML.length > 0); var $tabWrap = $titleWrap.parent().parent(); var $hiddenTab = $tabWrap.hasClass('ui-tabs-hide'); if($collapsedTitle && !$hiddenTab){ this.click(); } }); $('#backToTop').click(); This script finds every collapsed section within the current tab, clicks each of those section-headers to make the section expand, then scrolls up. Step 3. Place the "Bottom Nav" field on your form. It should be the last field on the form. In addition, it should be immediately preceded by a section-header that has no name. Why a nameless header? Because it will be exempted from the collapsing and expanding actions of the JavaScript. We don't want the buttons to hide (collapse) or expose (expand) themselves! This last point reveals an important caveat for the whole method described here. It works best on forms in which all sections, except the last one containing the buttons, have a name. That's because of the way Quick Base handles nameless sections; essentially, they are intended to stay expanded (within a Tab, if applicable).97Views3likes7CommentsSend Email"" Button with custom text and fields
I know that there are lots of posts on email generation; I've read many, many of them and still have not found a clear explanation of a solution for what I'm trying to do (i.e., with specific URL formulas etc.). I have a project tracking database. When all of the data for a new project is created, I need a button, call it "Send Project" that generates a custom email to an email address included as a field in the main form. The basic email notification triggers do not work.I don't want it to send upon addition/deletion/modification of the record. I've tried to use a toggle field "ReadyToSend", to trigger the form when checked, but could not get that to work. That said, I do like the ability of custom notifications to combine custom text and form fields. I've tried my hand at URL-Formula button in its simple form, like this: URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & ToText([Record ID#]) & "&dfid=10" but that has two problems.It simply invokes the Mail interface, and requires me to address the email (which is limited to registered users; the intended recipient is not a Quickbase user). Second, it sends the whole record (which logically follows from the foregoing). The text of the email should be something like Our Ref. No.: [Our Matter] [Receipient Name]: Attached you will find a project for [Client].. <other text and fields> Please complete the project by [Due Date]... Sois this done via a Notification? A Form? a Button/URL? A combination of these? Can you provide the prototype syntax? Thanks Robert130Views3likes14CommentsDate stamp formula for checkbox
Hello. I have a quick question regarding date stamps. I have two check-boxes on my form: import and export. For both, I hope to create a formula date stamp field to see when users ticked these boxes. We have a few older records to see when they were imported and exported. When they built this application, they did not anticipate the importance of these check-boxes. Is this at all possible? Thank you very much for all of your help!60Views3likes23CommentsButtons with color, function and flexability
I wanted a button that could be colored to any color, change data, disappear if criteria was met and return to the same location it was used thus allowing end users to have the button wherever they wanted and in multiple locations. Also I wanted to have name of the button be dynamic and the name change based on data in a the record. So pretty much I wanted most everything. Being a very low code person I used the forum and Quick Base support. I found that nobody was asking for all of that. In a matter of a week I have pieced together the code thanks to many contributors in the forum (if you answered anything on any of the items I wanted you are on the list). Here is the code and below some explanation, I hope this can help someone looking as much as I wanted. This is used in a text-formula field with html enabled. It is a check-in button (we also have a version that changes to a check-out after check-in is clicked...basically multi-function) // Begin button style var text bgcolor = "#A5E294"; var text txtcolor = "black"; var text style = "style=\"text-decoration: none;\n\n box-shadow: 3px 3px 1px #888888; \n\n background:" & $bgcolor & ";\n\n border-radius: 3px;\n\n padding: 5px 8px;\n\n color: " & $txtcolor & ";\n\n display: inline-block;\n\n font: bold 700 24px/1 \"Calibri\", sans-serif;\n\n text-align: center;\n\n text-shadow:none;"; // End button style var text URL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_13="&URLEncode(Now()) & "&_fid_25=" & URLEncode("Tech Onsite"); If(ToText([Lead Tech Day 1 Check-In])="", "<a " & $style & " href=" & "javascript:" & "$.get('" & $URL & "',function(){" & "location.reload(true);" & "});" & "void(0);" & "> Check-In "&[Technician Name]&"</a>", "") #A5E294 ? HTML color code for button color Black ? color wording for button text. This can be replaced with HTML color code & "&_fid_13="&URLEncode(Now()) & "&_fid_25=" & URLEncode("Tech Onsite"); This is the section of code defining the changes to make. Make sure that the last change end with a semi-colon! If(ToText([Lead Tech Day 1 Check-In])="", The if statement that creates the condition to show the button Check-In "&[Technician Name]&" The name of the button, note the syntax to use if wanting to have a dynamic name with data from a field in the record5Views3likes4CommentsProblem with if/and/or statement
Hello, I am trying to build an if/and/or statement that does the following: If record owner = "this role" and checkbox A is "true", then show this generate template button or If record owner = "not this role" and checkbox A is "not true", then also show this generate template button Sample: If([Record Owner]="HR Advisor" and ([HRBP Approval]="true"),[Save & Generate Template], If([Record Owner]=NOT"HR Advisor" and ([HRBP Approval]="null"),[Save & Generate Template])) So far, I am receiving syntax errors and have not been able to build the formula properly. If anyone has any suggestions that would be super helpful. Thank you!16Views2likes1Comment