Forum Discussion
DavidBrogdon
7 years agoQrew Assistant Captain
You can always pass the string via URL parameter to a custom code page and do the string coding there via JavaScript or whatever. You can then display the value on the code page if you are just needing to know the number. There are additional options for putting that value back into a record field but it is more lengthy.
- LanePemberton7 years agoQrew CadetGood suggestion David. I've used the IOL technique before but mostly as an action that runs off of a button click. I'm not sure the best way to run JavaScript from a formula and have it auto calculate (I guess that will be my next question). It would be nice to be able to use 'search', 'indexOf', 'match', etc.
- DavidBrogdon7 years agoQrew Assistant CaptainYou don't need the IOL technique for this. Just create a custom URL button that points to your custom code page. Pass the string value to the code page through the URL. Create the code page as an html document with a script tag that pulls a parameter value from the address bar and puts it into a variable.
URL Button Example:
https://[domain].quickbase.com/db/
?a=[code page id]&[parmater=value]
https://dummycompany.quickbase.com/db/xxxxx?a=showpage&pageid=1&mystring=thisstring
HTML Document Example:<script>
function getUrlParameters() {
var params = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,
function(m,key,value) {
params[key] = value;
});
return params; }
function doSomeCode(){
var string=getUrlParameters() ["mystring"]; //do some code
}
</script>
This may take some tinkering but it works good for me so far. - LanePemberton7 years agoQrew CadetThat looks awesome. However, I want the script to execute automatically on every record (e.g. Formula - Text), not just when I click a button. Would it work the same in that instance?
- DavidBrogdon7 years agoQrew Assistant CaptainIf you wanted the script to run on each load of a record you would need to use the IOL technique I believe