Retrieve URL of all Knack Apps
If you need a list of knack applications, you can retrieve them from the console when signed into the builder.
Steps to retrieve all URLs of Knack applications
JavaScript
// Retrieve relevent fields in Knack Dashboard
let appNameFields = document.querySelectorAll(`a[data-testid="apps-table-app-name-field"]`); // Gets App Name
let appRecordFields = document.querySelectorAll(`div[data-testid="apps-table-app-records-count"]
> div[data-testid="asterisk-tooltip-trigger"]`); // Gets record text
let appStorageFields = document.querySelectorAll(`div[data-testid="apps-table-app-storage-count"]
> div[data-testid="asterisk-tooltip-trigger"]`); // Gets storage text
let appBuilderUrls = document.querySelectorAll(`a[aria-label="App builder"]`); // Gets builder Url
let appLiveUrls = document.querySelectorAll(`a[aria-label="Live app"]`); // Gets live Url
let myarray = [];
// Add to array the following fields
for (let i = 0; i < appNameFields.length; i++) {
let nameAppText = appNameFields[i].innerText;
let recordText = appRecordFields[i].innerText;
let builderUrl = appLiveUrls[i].href;
let liveUrl = appLiveUrls[i].href;
// To do - In the future pull storage data text as a number and whether it is MB/GB
myarray.push({
"Application Name": nameAppText,
"Records": Number(recordText),
"Builder": builderUrl,
"Live App": liveUrl
});
}
console.table(myarray);Last updated
Was this helpful?