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
------------------------------
Original Message:
Sent: 06-15-2022 10:41
From: Simon H
Subject: Quickbase Code page to query a table and display records
If I am reading this correctly, you are misusing the javascript source tag's src parameter.
That is where you would put the URL for a valid JS file, not a QuickBase API url
What you want to do is pass that query URL to the code page as a query parameter, and then have a script on the page make the query and render the table
------------------------------
Simon H
Original Message:
Sent: 06-15-2022 04:26
From: Aswin Babu
Subject: Quickbase Code page to query a table and display records
I have created a code page which should query a table and display certain records using API -GenResults table. I am going to embed this code page in forms. Based on value in each record(in field - test temp inventory query) the contents in the table changes.
Below is the code page code
<html>
<head>
<script src= ~test temp inventory query~ lang="text/javascript">
</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>
<h1>Example</h1>
<table cellpadding=5 bgcolor=lightgreen>
<tr>
<td>
<script lang="text/javascript">
qdbWrite();
</script>
</td>
</tr>
</table>
</body>
</head>
</html>
The third line, value of src determines the query. ~test temp inventory query~ is the field where query is created as a formula text .
The value in formula text looks something like this
But the contents are not getting pulled correctly. Which is best way to pass value in field to the QuickBase code page and display the link to code page as embedded in the same form. ?