Search Results for 'script'
-
Search Results
-
Hi Brendan,
I’ve noticed what seems to be a grouping issue with Number fields in Tap Forms Pro.
If a Number field contains a value and I delete that value, the field correctly appears empty. However, when I use this field with Group Records By, the record is placed in the 0 group, as if the empty field actually contained the value 0.
I checked the value with a script:
var value = record.getFieldValue(‘fld-0de…….’);
if (value === undefined) {
return “UNDEFINED — no value”;
}return “VALUE: ” + value;
For the affected record, the script returns:UNDEFINED — no value
So the Number field really is empty and does not contain 0. It seems that Group Records By is treating undefined and the numeric value 0 as the same grouping value.
Would it be possible for empty Number fields to remain in a separate empty group, rather than being grouped together with records whose value is actually 0?
Thanks!
Hi Brandon,
hi all,I have been experimenting with a script in the last couple of days and ended up with a reproducible crash of Tap Forms with one version of it, that I thought that someone might want to look into. (Disclaimer: AI helped me write the script as my capabilities in JavaScript are beginner level at best).
What I was doing: I have a script button on a custom layout that lets me pick an existing record from another form and link it via record.addRecordToField(), using Prompter.new() with a ‘popup’ parameter to show the choices. To add several linked records in one go, we wrapped that in a while loop and added a second Prompter (a simple Yes/No confirm using addParameter(message, null, “label”)) asking “add another?” after each pick.
The bug: As soon as this script has two different Prompter-based functions in it — even though the second one (the confirm) is never actually reached — the very first prompt crashes the whole app the moment I click its Continue button. It’s 100% reproducible, happens both from the live layout button and from the script editor’s own Run button, and happens regardless of which item I pick in the dropdown (including leaving it on the default first item).
If I strip the script down to a single Prompter call with no loop and no second Prompter function anywhere in the script, it works perfectly every time.
Here’s the full script that causes the crash:
async function Pick_Subtheme() {
await pickSubtheme();
}async function pickSubtheme() {
var keepAdding = true;
while (keepAdding) {
var chosen = await promptPopup(“Add a Subtheme:”, “Pick Subtheme”, [“Episode IV – A New Hope”, “Episode VI – Return of the Jedi”, “Classic Star Wars”, “Lego Star Wars – Ultimate Collector’s Series”]);
if (!chosen) { keepAdding = false; break; }
// … link the chosen record …
keepAdding = await promptConfirm(“Add another Subtheme?”, “Add Subtheme”, “Done”);
}
}function promptPopup(message, popupName, valuesArray) {
return new Promise(function (resolve) {
choice = undefined;
var p = Prompter.new();
p.addParameter(message, “choice”, “popup”, valuesArray, valuesArray[0]);
p.cancelButtonTitle = “Cancel”;
p.continueButtonTitle = “Add”;
p.show(popupName, function (status) {
resolve(status === true ? choice : false);
});
});
}function promptConfirm(message, continueTitle, cancelTitle) {
return new Promise(function (resolve) {
var p = Prompter.new();
p.addParameter(message, null, “label”);
p.cancelButtonTitle = cancelTitle;
p.continueButtonTitle = continueTitle;
p.show(message, function (status) {
resolve(status === true);
});
});
}var choice;
Pick_Subtheme();The crash happens the moment I click “Add” on the very first popup — execution never even reaches promptConfirm.
Crash log (Thread 0, the crashed thread):
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Reason: *** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]Termination Reason: Namespace SIGNAL, Code 6, Abort trap: 6
Terminating Process: Tap Forms Pro [31720]Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
…
10 CoreFoundation -[__NSArrayM objectAtIndex:] + 592
11 Tap Forms Pro 0x104f1a564 0x104dd0000 + 1353060
12 CoreFoundation __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
…I am using Tap Forms Pro 1.3.1 (Build 560) with macOS Tahoe 26.6.2.
I’m happy to send the full crash report if useful. Thanks for looking into it!
Melanie
In my Document there are a number of Forms, each of which has a field (all called “Import”). For some records in the Import field in each Form there is a letter “X”.
This setup distinguishes records imported from another database. After some work on the imported records, I wish to delete the content of the fields which contain the “X” (not the record itself).
The (Form) script I have to do this is below (one for each Form).
However, I have to go into each Form and run the script.
Is there a way:
1. to run all the scripts at once (one after another)?, or
2. to have a (Document) script which can go into each Form and delete the X in the Import field.The script:
var importFieldID = 'fld-6514c959cf9d4b169d3696a6ba49a56b'; [Changed for each Form] // Get all records in this Form var records = form.fetchRecords(); var changed = 0; for (var i = 0; i < records.length; i++) { var rec = records; // Get the value of the Import field var value = rec.getFieldValue(importFieldID); // Only clear records where Import is exactly X if (value == 'X') { rec.setFieldValue(importFieldID, ''); changed++; } } // Save the changes document.saveAllChanges(); console.log('Records changed: ' + changed);Any help would be gratefully received.
Hello there,
I have recently switched from Tap Forms 5 to Tap Forms Pro.
While everything looks promising so far, there is an issue that I have not been able to solve.
I usually make my own Layouts in Tap Forms 5 and like to customize everything so it is not only visually pleasing but also easy to navigate.
Coming from Tap Forms 5 I always hated the look of linked forms in custom layouts. They are bulky, barely customizable in shape and color and jump out of the surrounding layout in a way that I find distracting.
In Tap Forms 5 I usually use a workaround:
I set the dimensions of the linked forms table very small, so that only the controls at the bottom of the field are visible. That lets me pick records to link or access them, but I don’t have to see the big white table in my parent layout. To display linked records in any parent form, I use a script that concatenates and displays values from the linked records. See screenshot for what that looked like in Tap Forms 5 you have the small linked form tables shrunk only to display the controls on the right and the values of linked records on the left.
In Tap Forms Pro, table fields of linked forms don’t really disappear anymore, when you make them really small, but part of the table always remains visible. Also, they seem to forget that you switched off their background color, so every time you re-open Tap Forms, they will appear with thick white frame in addition to the table portion that can not be hidden or changed in color (see second screenshot). It is annoying.
I have been wondering if there is a different workaround from the one I have been using, possibly by using scripting. I am just not that experienced in using Java Script. Is it even possible to embed a button in a form that lets you run a script and have that script take you to the linked records in that linked form?
Any help or ideas will be greatly appreciated!
Melanie