Forum Discussion
ChayceDuncan2
6 years agoQrew Cadet
Where is the actual data coming from? Is it from another Quick Base table, an external source?
For clarity - you description has an odd statement about trying to call IOL from a formula-url. IOL is used when you need to run a script without user intervention. The idea being that when an image loads on the page - your browser does something with that, like run a script. So perhaps I'm misunderstanding - but those two normally aren't combined and that you have to click a formula-url.
If you're clicking a button - getScript is one option - another is to actually just use a Quick Base code page.
getScript is a jQuery function - in this case, that would call out and load your JS file, and you could have a button on a Quick Base run your function with your getScript
A Quick Base code page is similar, in that you could set up a simple HTML page, and write you own Javascript into it. The advantage being there that you're not bound by Quick Base formula syntax and it makes it 100x easier to debug on the fly.
In that case - all you do is make a formula-url that directs you to the code page like:
https://yourrealm.quickbase.com/db/appDBID?a=dbpage&pageid=2
Where page ID 2 is your code page that contains HTML and JS. What I do a lot in this is just to put a really simple spinner as the HTML body so you know the page is doing something, and then all of you JS just runs. Once its done - you kick a re-direct back where ever you want.
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base
For clarity - you description has an odd statement about trying to call IOL from a formula-url. IOL is used when you need to run a script without user intervention. The idea being that when an image loads on the page - your browser does something with that, like run a script. So perhaps I'm misunderstanding - but those two normally aren't combined and that you have to click a formula-url.
If you're clicking a button - getScript is one option - another is to actually just use a Quick Base code page.
getScript is a jQuery function - in this case, that would call out and load your JS file, and you could have a button on a Quick Base run your function with your getScript
A Quick Base code page is similar, in that you could set up a simple HTML page, and write you own Javascript into it. The advantage being there that you're not bound by Quick Base formula syntax and it makes it 100x easier to debug on the fly.
In that case - all you do is make a formula-url that directs you to the code page like:
https://yourrealm.quickbase.com/db/appDBID?a=dbpage&pageid=2
Where page ID 2 is your code page that contains HTML and JS. What I do a lot in this is just to put a really simple spinner as the HTML body so you know the page is doing something, and then all of you JS just runs. Once its done - you kick a re-direct back where ever you want.
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base
- DougHines6 years agoQrew TraineeMy results when using getScript were not very clear.
Initially I setup a code page : addTNRange.js
The only thing that this page had was an alert() letting me know the page was successfully sourced.
I made a var that pointed to this code page in the usually manner and made a getScript($url) call that worked.
My thinking next was to create a function inside the addTNRange.js and then to call that using getScript, but that's where everything derailed. I kept getting pages with [object Object] regardless of what I tried.
I will try your method of calling an html page instead of a js page, or is there a difference? - QuickBaseCoachD6 years agoQrew Captain... back to Chayce's question .. where do these "phone numbers" come from? Is this some external data source or are they in Quick Base somewhere? Maybe there is an easier way. Can you stand back from the javascript and tell us the overall big picture goal here.
- ChayceDuncan26 years agoQrew CadetTo answer your final question about an HTML page vs JS - the answer is primarily just the debugging. Using getScript() in the formula means you're debugging using a Quick Base field which is much more challenging. Using a generic HTML page at least allows you to see your code in action a little bit more clearly.
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base - DougHines6 years agoQrew TraineeTo answer Chayce's question, the phone numbers come from data that we get from our customers and have to manually enter at this time. (We're in telecom). We deal with thousands of phone numbers per account. Our current method of entry for a range of phone numbers starting at 111-111-1111 and ending at 111-112-9999 is to make a series list in Excel, then slowly but surely copy and paste special into our editable table. Since Quickbase by default only shows 4 or 5 extra rows in this mode, we can only increase the number of records 4 at a time... over the span of many many phone numbers.
- ChayceDuncan26 years agoQrew CadetSo is the end goal then to mass populate a table with phone numbers? It sounds from the above that you're trying to grid-edit add new phone numbers as your method of population. Is there a reason you're not using the Import functionality to upload your file that you're receiving from your customer?
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base - QuickBaseCoachD6 years agoQrew CaptainI think that Doug is saying that they provision blocks of purely sequential numbers, is that correct Doug?
If so this can be done with low code no code and no javascript. I can suggest a low code no code solution if that is the challenge. - DougHines6 years agoQrew TraineeSorry for the long wait in the reply. I don't have access to work email on the weekend.
To answer everyone's questions :
Yes. The end goal is two fold : to populate a mass of Telephone numbers and decrease the time/clicks my coworkers perform adding the records. However, would rather not have accidents occur, which is entirely possible with the import function (I'm assuming you're speaking of the "import data from a file" option)
The best case scenario would be that they're all in sequence. Unfortunately there are often times we will have a few missing phone numbers that breaks a block of numbers into multiple blocks. On the flip side, we also have instances where there are absolutely no numbers in sequence. (I handle those personally via the import method). The solution I am attempting to create would be for those instances of sequenced numbers. My coworkers would simply need to enter the first telephone number and last telephone number, and the script would handle the procedural stuff and error checking. - QuickBaseCoachD6 years agoQrew CaptainI can post a native solution with no script later this week. But see if this is enough to get you there.
The gist of it would be to have a table loaded with sat 10,000 sequential Record IDs
Call that sequential table Import Source.
Then make a new table with a single record in it where you will enter the start and stop range.
Make a relationship down to that sequential table so now the sequential table can know the start and stop range.
Then make a formula feel the text the record ID and add it to the start number.minus 1.
Then create a saved table to table import import from the sequential table into the target table subject of the filter that the formula field is less that the End number tangle.
Leslie make a button on the control record visible lonely and view mode that will run the import and then plan to use her on a report of the newly added records. - ChayceDuncan26 years agoQrew CadetIf you're still looking to actually script it - I would still recommend going with a code page. You'll have more ability to actually have a UI - and have an interface for error checking or reviewing what gets done in your script for the end user to see. Using getScript in a formula will have a lot less opportunity to be able to do that.
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base - DougHines6 years agoQrew TraineeI've moved to the code page route.
I have a html file that I can successfully call from a formula URL on one of my tables. I am now running into a road block of being able to pass/store field values so I can use them in the code page.
I'm currently attempting to use a sessionStore, but I think the conversion into quickbase scripting is throwing me for a loop. Is sessionStoring of parameters a smart way to pass this data?