I have this silly button-script getting a random Chick Norris joke and updating a field in the current record/form. But the update (new joke) only appears if a refresh my browser tab. How can i have the button-script update the browser tab immediately after the scrip is finished?
const response = await fetch(“https://api.chucknorris.io/jokes/random”);
if (!response.ok) { throw new Error(API failed: ${response.status}); }
const payload = await response.json();
if (!input.recordId) {
throw new Error(“No record ID provided.”);
}
const host = await base.getRecordById(input.recordId);
if (host) {
await host.setCell(“joke”, payload.value);
await anydb.yield();
}
console.log(payload.value);