Forum Discussion
Winss
Qrew Trainee
Api Query is now passed as a parameter for code page.
Like shown below.
------------------------------------
var text embedurl="https://jewelry.quickbase.com/db/be4uqew75?a=dbpage&pageID=151&qrytext=" & URLEncode([test temp inventory query]); //test using parameter passing
$embedurl
-------------------------------------
[test temp inventory query] is the API Genresults API link which looks like
Code page is updated like as shown below.
------------------------------------------------------------
<html>
<head>
<script lang="text/javascript">
let urlParams = new URLSearchParams(window.location.search);
let qrytext = urlParams.get('qrytext');
</script>
<style>
td.m { font-family:verdana; font-size:70%; }
td.hd { font-family:verdana; font-size:70%; font-weight:bold;
color:white;}
</style>
</head>
<body>
<table cellpadding=5 bgcolor=lightgreen>
<tr>
<td>
<script lang="text/javascript">
qdbWrite();
</script>
</td>
</tr>
</table>
</body>
</head>
</html>
---------------------------------------------------------------------
Still not working
------------------------------
Aswin Babu
------------------------------
Like shown below.
------------------------------------
var text embedurl="https://jewelry.quickbase.com/db/be4uqew75?a=dbpage&pageID=151&qrytext=" & URLEncode([test temp inventory query]); //test using parameter passing
$embedurl
-------------------------------------
[test temp inventory query] is the API Genresults API link which looks like
https://Domain.quickbase.com/db/iddbdbdbid?a=API_GenResultsTable&apptoken=tokn123 t=1&query={'29'.CT.'TYCU700'}OR{'29'.CT.'TYRD60'}OR{'29'.CT.'TYTG8580'}&clist=29.17.7.9.8.38.44.49&slist=17 |
Code page is updated like as shown below.
------------------------------------------------------------
<html>
<head>
<script lang="text/javascript">
let urlParams = new URLSearchParams(window.location.search);
let qrytext = urlParams.get('qrytext');
</script>
<style>
td.m { font-family:verdana; font-size:70%; }
td.hd { font-family:verdana; font-size:70%; font-weight:bold;
color:white;}
</style>
</head>
<body>
<table cellpadding=5 bgcolor=lightgreen>
<tr>
<td>
<script lang="text/javascript">
qdbWrite();
</script>
</td>
</tr>
</table>
</body>
</head>
</html>
---------------------------------------------------------------------
Still not working
------------------------------
Aswin Babu
------------------------------
SimonH
3 years agoQrew Cadet
Heres a bit of a hacky method that should work.
The page below will manually build and append the script tag after retrieving the src from the query, then call qdbWrite after it has loaded
------------------------------
Simon H
------------------------------
The page below will manually build and append the script tag after retrieving the src from the query, then call qdbWrite after it has loaded
<html>
<head>
<script>
let urlParams = new URLSearchParams(window.location.search);
let qrytext = urlParams.get('qrytext');
var s = document.createElement("script");
s.type = "text/javascript";
s.src =qrytext ;
document.head.appendChild(s);
window.addEventListener("load", function(){
qdbWrite();
});
</script>
<style>
td.m { font-family:verdana; font-size:70%; }
td.hd { font-family:verdana; font-size:70%; font-weight:bold;
color:white;}
</style>
</head>
<body></body>
</head>
</html>​
------------------------------
Simon H
------------------------------
- Winss3 years agoQrew Trainee
This worked very well. Thank you so much Simon!.
Anyone looking for same solution here is the summary.
1. Create a API gen results link for eg.
https://Domain.quickbase.com/db/iddbdbdbid?a=API_GenResultsTable&apptoken=tokn123 t=1&query={'29'.CT.'TYCU700'}OR{'29'.CT.'TYRD60'}OR{'29'.CT.'TYTG8580'}&clist=29.17.7.9.8.38.44.49&slist=17
2. Create a code page link that has in parameter the value of field [test temp inventory query]
(Let the code page that we going to create have page id 150)
"https://Domain.quickbase.com/db/bdadad5?a=dbpage&pageID=150&qrytext=" & URLEncode([test temp inventory query])
parameter is value in qrytext
This formula URL should have embed as iframe in form options checked. (In field settings)
3. Create code page with page id 150 as<html> <head> <script> let urlParams = new URLSearchParams(window.location.search); let qrytext = urlParams.get('qrytext'); var s = document.createElement("script"); s.type = "text/javascript"; s.src =qrytext ; document.head.appendChild(s); window.addEventListener("load", function(){ qdbWrite(); }); </script> <style> td.m { font-family:verdana; font-size:70%; } td.hd { font-family:verdana; font-size:70%; font-weight:bold; color:white;} </style> </head> <body></body> </head> </html>
------------------------------
Aswin Babu
------------------------------
Related Content
- 6 months ago
- 6 months ago