Forum Discussion
BrianCafferelli
5 years agoQuickbase Staff
Hi Ivan,
Inserting Javscript into Quick Base formulas is an unsupported technique, and later this year we will begin blocking any new Javascript code from being added in this way. This is an important change to the platform as Quick Base was never designed for arbitrary code to be used in formulas, and it causes a lot of issues being able to support such apps and to pass them on to other admins in your company.
We're looking into improving our formula language to allow for reloading the page, but in the meantime we recommend copying your formula for each report/dashboard it appears on.
Thanks,
Brian
------------------------------
Brian Cafferelli
Product Marketing Manager | Quick Base
------------------------------
Inserting Javscript into Quick Base formulas is an unsupported technique, and later this year we will begin blocking any new Javascript code from being added in this way. This is an important change to the platform as Quick Base was never designed for arbitrary code to be used in formulas, and it causes a lot of issues being able to support such apps and to pass them on to other admins in your company.
We're looking into improving our formula language to allow for reloading the page, but in the meantime we recommend copying your formula for each report/dashboard it appears on.
Thanks,
Brian
------------------------------
Brian Cafferelli
Product Marketing Manager | Quick Base
------------------------------
AustinK
5 years agoQrew Commander
Should this be considered the announcement for Quick Base not supporting any type of JavaScript in formulas then? What happens to old formulas that are there already that have the same functionality? When will we expect to see this go live? Will there be a point where you do this to current formulas as well which will break them or will that not happen?
Maybe I missed a previous announcement but this is the very first time I am seeing this being said.
Maybe I missed a previous announcement but this is the very first time I am seeing this being said.
- BrianCafferelli5 years agoQuickbase StaffHi Austin,
While I didn't specifically intend to break news with my above post, yes this may be the first time this change has been mentioned on this forum.
To clarify, inserting javascript code into formulas, branding, etc has never been supported but the change we're planning to make is to prevent javascript from being inserted in places where it was not already there, and to prevent changes to formulas that have previously had javascript added. javascript has always been intended to be used in code pages and that will continue.
This change will not impact existing formulas that use javascript, in that they will be continue to work as-is after the change. We currently have no plans to stop supporting that. However, this seems like a good opportunity to remind folks that it is never a good idea to use javascript that way as those formulas could stop working at any time without warning. That continues to be the case, and those formulas will become more likely to break as we work to update the Quick Base UI over the next few years (for those who leverage DOM objects in their javascript-powered qb formulas).
We'll have more details to share about these plans in the coming months.
------------------------------
Brian Cafferelli
Product Marketing Manager | Quick Base
------------------------------- AustinK5 years agoQrew CommanderThanks for the information. We for the most part avoid any of the BOL or tricks like that for this reason. We do rather prolifically use a formula similar to the above one for reloading the page as that is not something Quick Base currently offers. I think if you added the ability to reload the page in a formula like you mentioned a few posts up that would be a huge help in transitioning away from using JavaScript.
- IvanWeiss5 years agoQrew CaptainBrian,
I certainly understand your position on the javascript but I really really really really hope that Quick Base is not purely going to block functionality that is clearly necessary without providing a way to do it. There are SOOOOO many people using that code block I am using for simple URL manipulation. I use it on my dashboards to reload the page etc.
I also am a bit concerned because I reached out to Quick Base support first for help on how to do this without Javascript and they said go to a partner. That was it, and with COVID my company is not in a position to invest in outside resources at the moment. And outside resources on community pointed me here.
In this particular example, all I am trying to do is fetch the current URL I am on and use it as my redirect. This is a button to "Complete a task". I use it on a dashboard report (so people can hit complete from the dashboard home page) as well as on the report link to the tasks table on my projects forms. Again so people can complete tasks without 5,000 clicks.
Right now I have one field with this button (since it appears in multiple places) and I use the javascript to determine where i am so I can redirect back to it. How would you suggest doing this without javascript? I would gladly get rid of the javascript if you can point me in the right direction here? But so far this is all the help I got.....
Thanks!
------------------------------
Ivan Weiss
------------------------------- BrianCafferelli5 years agoQuickbase StaffHi Ivan,
Since Javascript is a general-purpose programming language, we know that Quick Base will never be able to solve every single problem which can be solved with javascript. On the contrary, as a no-code platform we aim to enable non-coders to solve a huge variety of important business problems much more quickly than could be done by coding a solution from scratch using a programming language such as javascript.
Speaking more specifically about your formula to reload the current page, we are considering a new feature which would allow that without the use of javascript. We're doing the same for a handful of other common problems which folks are solving by inserting javascipt into qb formulas today, and we expect to share more information on those features later this year.
Now, putting the future of Quick Base aside for a minute, I understand the time savings you get by allowing someone to update a large number of records without their having to click back to the previous page for each record. Without using javascript in your formula, I think you've got a few options:
- Using grid edit instead would allow someone to update the status of one record as Completed, then quickly copy and paste to each other record they want to update.
- Or, if you wanted to go with the button you can redirect to a specific page. For example, if the button is on the List All report (QID=1), you would use this formula:
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_6=Completed&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=q&qid=1")
For the formula above, if you have multiple pages where you want the button to appear, you can copy the field for each other page, like your dashboard, and each version of the formula would redirect to a different page. The setup for that is a little more complex but it provides the same streamlined workflow for your app's users.
Then, if neither of those work well, that's when I would consider whether it's worth working with one of our partners to build a custom solution that may meet your needs better.
------------------------------
Brian Cafferelli
Product Marketing Manager | Quick Base
------------------------------