Skip to content
Coda JS API generator
Share
Explore

Templates

Below you will find all your generated JS templates.
You can paste this code in your JS file of any web project, or an HTML page between the “<script></script>” tags.
The last thing you will need to do is to create an HTML <div> element where your data will be displayed in. You can paste the following code in your HTML file:
<div id="testText"></div>
Note, you will need to add the Jquery CLI to your project of web page if you aren’t using it yet.
Here is the Jquery 3.3.1 CLI, which you can add before the closing </head> tag in your HTML:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
Your templates
4
Search
#1 - Paleo Jobs
Jun 13, 2021, 5:12 PM
#4 - Privacy Policy
Jun 13, 2021, 7:42 PM
Template ID
1
Template name
Paleo Jobs
JS formatted
let testPositionCode
const urlStart = 'https://coda.io/apis/v1/docs/'
function listSpecificRows() {
$(document).ready(function () {
$.ajax({
url: urlStart + 'uFOzhM8tYk' + '/tables/' + 'grid-WKOmDFiW-K' + '/rows',
type: 'GET',
headers: {
'Authorization': 'Bearer '
},
success: function (result) {
let rowResults = result
let filteredResults = rowResults.items.filter((res) => {
return res.values['c-6euPSWeAb9'] == testPositionCode;
});
console.log(filteredResults);
$('#itemQtInPosition').html('There are ' + filteredResults.length +
' items in position ' +
'<strong>' + testPositionCode + '</strong>');
$('#testText').html(filteredResults.map(function (item) {
return `<div role="listitem" class="job-item w-dyn-item">
<div class="job-card">
<div class="job-description">
<h5>${item.values['c-mhUyyGvLg1']}</h5>
<div class="job-detail">${item.values['c-FOr9fIJl8f']}</div>
<div class="horizontal-detail-wrapper">
<div class="job-detail">Division: ${item.values['c-pa5vUxB2u0']}</div>
<div class="job-detail">Location: ${item.values['c-Um_0Rx6ra7']}</div>
</div>
<div class="horizontal-detail-wrapper">
<div class="job-detail">Skills: <span>${item.values['c-EFl4luyWVd']}</span></div>
</div>
</div><a target="_blank" href="${item.values['']}" class="button-secondary-small w-button">Apply</a>
</div>
</div>`
}).join(''))
console.log('List specific rows success')
},
error: function (error) {
alert(error);
}
});
});
};
listSpecificRows()
Show hidden columns
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.