Search Results for 'script'
-
Search Results
-
I can see from previous posts there isn’t an on-form-load trigger event in which I could attach a script to do a series of things or update calculated fields when I open my datbase, but I could make a script which I manually trigger or I manually click refresh records.
I wondered about an idea that might achieve the same thing but allow me a level of automation/scheduling via a backdoor sort of route.
I sync my database with CouchDb (hosted on my NAS), I wonder if I could issue a command to make a tiny edit in the TapForms CouchDb to my database, which would then cascade a refresh to TapForms, and this would then force the calculated fields or scripts to execute.
the Apple Script code to do something to couchdb would be based on:
— Define CouchDB URL and credentials
set couchdbURL to “http://192.168.1.240:5984/db-1a619b6d486c466c9fc32a1b4a494f00” — Replace with your CouchDB URL
set couchdbUser to “admin” — Replace with your CouchDB username
set couchdbPassword to “removed” — Replace with your CouchDB password— Create the shell command for the curl request
set curlCommand to “curl -u ” & couchdbUser & “:” & couchdbPassword & ” ” & couchdbURL— Run the shell command
do shell script curlCommand— Optional: Notify completion
display notification “CouchDB refresh request sent” with title “CouchDB Refresh”what I’m not sure, having looked in CouchDb is what or where i’d start to make a tiny tweak. i.e. i could create a dummy field in TapForms I don’t need, but I changed via AppleScript to cascade a refresh.
Thoughts anyone????
Cheers
Topic: Check List via a Table?
I’m wanting to create a table as a list of jobs to do, and have table fields that include things like ‘Task’ ‘Priority’, ‘Done’. (where Done is a check-mark).
I’d wondered if I could add a script field into the table that somehow runs whenever the check-mark is checked, and it’ll run a script like something below, to delete the row that I’ve just added the check-mark against, sort of acting like a to-do list that deletes completed tasks.
the below runs but it doesn’t work, and I wonder if I’m missing anything obvious.
function deleteCheckedRows() {
var tableFieldID = ‘fld-e6d2b5eaf2fb4e78b708ff36d05f31a5’;
var checkmarkFieldID = ‘fld-475a8bbcba634befbca61e39a61fef8c’;// Get the rows in the table field
var tableRows = record.getFieldValue(tableFieldID);// Array to hold the rows that should remain
var rowsToKeep = [];// Loop through each row in the table field
for (var i = 0; i < tableRows.length; i++) {
var row = tableRows;// Check if the checkmark field is selected (true)
if (!row.getFieldValue(checkmarkFieldID)) {
// If not selected, keep this row
rowsToKeep.push(row);
}
}// Set the filtered rows back to the table field
record.setFieldValue(tableFieldID, rowsToKeep);// Save changes
document.saveAllChanges();// Optional: Provide feedback
Utils.alertWithMessage(“Checked rows deleted”, “All checked rows have been deleted.”, “info”);
}// Run the script
deleteCheckedRows();I have a Form for which I need to delete all its records and then import them afresh from a CSV file (I use defined presets when importing Records in TapForms). The CSV file gets generated outside of TapForms, and I’m just wondering if there’s a semi-automated way of doing this via a script. Any pointers are much appreciated.
Hi I am trying to display text from a field in a table to a field on the same form but not in the table.
The formula should be simple: in the calculation field, using the left panel that shows all available fields, select the field in the table that I want to display.
But when I do this, the formula prepopulates a “TOTAL” in front of the field name. This is not what I want. I don’t know why it wants to give me a total when I am looking for the value of the field, not a total for the column.
I have tried a script with the field ID from the table but it does not work because I am writing to a field outside the table. Maybe a workaround is if someone can show me the syntax to reference table field ID ‘xyz’ for example, noting I need to pull this value into a field that is not in the table (but it is on the same form).
Any help is most welcome!