Tahnks Daniel.
I tried it and got an error off the bat. What I learned of scripting a year or so ago I’ve forgotten.
======= I typed the following and got this comment.
3/16/26, 4:14:05 PM / !Poop / Condition+
Condition+: SyntaxError: Unexpected identifier ‘Picklist_Value’, line:1
=================
Function Picklist_Value(){
const pickllist_id=’fld-3bf9d801a4334f17815a4e131c3fa83c”;
const picklist=recordxgetFieldValue(picklist_id);
//check that picklist has a value
if (picklist){
//split picklist value and use first element
const number=String(picklist)xsplit(‘;’)[0];
//return Number
return Number(NUMBER);
}
}
==========
So, Q1 – Is that Picklist a reserved word and we can’t use it?
and Q2 – Is the field id # that have there supposed to be another field? I dont think so, I used the field # associated with the field this script is written into (is that correct?).
I guess this will take a while. Thanks.
Hi Glen,
You could use a picklist format like ‘1: Red’, ‘2: Blue’, ‘3: Green’ and then add a field script to extract the value before the column:
function Picklist_Value() {
const picklist_id = 'fld-xxx';
const picklist = record.getFieldValue(picklist_id);
// check that picklist has a value
if (picklist) {
// split picklist value and use first element
const number = String(picklist).split(':')[0];
// return number
return Number(number);
}
}
Picklist_Value();
This script returns a ‘Number’ so you have to set the return type accordingly.
Now you can create your graph using the return value of this script and don’t need to remember the values when using the picklist.
Hope this helps!
-
This reply was modified 5 months ago by
Daniel Leu.
-
This reply was modified 5 months ago by
Daniel Leu.
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks
I need a field that is a number that can be used in a graph against time.
To fill that field I would like it to be a quick pick list. That is easy.
The number represents certain conditions which I don’t always remember.
The only way to do this is with a text box describing each number that shows up in the pick list.
Is there a more elagent way to do this within the pick list instead of having those descriptions on the face of the form?
I’m not sure it’s the latest 1.1 update or the fact that I just restored from a backup. But this script used to create new record in another form and link it and display it immediately in the record. Now I have to go out of the record into the other form and then back for it to show up. Is it my script or has something changed in Tap Forms Pro?
function CopyToEbaySales() {
// --- 1. CONFIGURATION ---
// A. Source Fields (From COINS Form) - HARDCODED IDs
var coin_type_id = 'fld-1231556e0f234de9b2d85f50225b8135';
var year_id = 'fld-4b84b047badd4d4cbb4a67ef6839522f';
var mint_id = 'fld-adb0be16f1a347dbbecc4ef562d779a7';
var photo_id = 'fld-d32730d871864ab2904cb60c587b105a';
var purchase_price_id ='fld-6deb90149d2b494fa3a3e89236398857';
// B. Destination Fields (From EBAY SALES Form) - HARDCODED IDs
var ebay_coin_type_id = 'fld-9fdddd3a7a47410394042488e730f6c0';
var ebay_year_id = 'fld-6bee0d6f1e2b413192715c2c807d526f';
var ebay_mint_id = 'fld-cc42485d28c14c99bbd4970619bee9cf';
var ebay_photo_id = 'fld-e4a157a02f4841dc845b3ce800565c8e';
var ebay_cost_id = 'fld-dfa5d5683deb466e9a8088d2d4db56a5';
// C. Link Field (From COINS Form) - DYNAMIC LOOKUP
// We get this ID automatically using the name.
var link_field_name = "Ebay Sale";
var link_field_id = form.getFieldNamed(link_field_name).getId();
// --- 2. EXECUTION ---
var ebayFormName = "eBay Sales";
var ebayForm = document.getFormNamed(ebayFormName);
if (ebayForm) {
// Create the new record in eBay Sales
var newEbayRecord = ebayForm.addNewRecord();
// Copy the data
newEbayRecord.setFieldValue(ebay_coin_type_id, record.getFieldValue(coin_type_id));
newEbayRecord.setFieldValue(ebay_year_id, record.getFieldValue(year_id));
newEbayRecord.setFieldValue(ebay_mint_id, record.getFieldValue(mint_id));
newEbayRecord.setFieldValue(ebay_cost_id, record.getFieldValue(purchase_price_id));
var photos = record.getFieldValue(photo_id);
if (photos) {
newEbayRecord.setFieldValue(ebay_photo_id, photos);
}
// Link the new record back to the current Coin record
if (link_field_id) {
record.addRecordToField(newEbayRecord, link_field_id);
} else {
console.log("Error: Could not find a link field named '" + link_field_name + "'");
}
// Save
document.saveAllChanges();
console.log("Success: Record moved and linked.");
} else {
console.log("Error: Could not find form named " + ebayFormName);
}
}
CopyToEbaySales();
-
This topic was modified 4 months, 4 weeks ago by
Brendan.
You can delete a button on the universal layout. Make sure you’re in layout edit mode and then tap the (x) button in the corner to delete it. But there may be an issue right now with selecting which script to use. It was working, but something must have changed just before release. I’ve already fixed it today so when you tap the button on iOS it will display the list of form scripts to select from.
It already works on macOS.
Hi Glen,
The script seems to be working. I just had to do a ‘recalculate formulas’ on the records.
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks
Incomplete synchronization with Cloud+ persisted in ver.1.1, but after importing into a new file and rebuilding it, synchronization became possible.
The synchronization date and time for the encrypted database is not displayed on the iPhone.
Now easier to use with universal layout
It’s convenient to be able to run scripts with buttons. Until now, I’d been using radio buttons as a substitute.
The buttons in the universal layout cannot be deleted or edited.
You gave me the script to add data from the previous record to the current record and I have it installed in my form, and I changed the reference to the previous record I think, but it isn’t working.
Can somebody solve this for me looking at my tfarc file?
I want todays data added to the running total of the previous record so the total gets bigger every record added.
Attachments:
You must be
logged in to view attached files.
If you export your records as CVS, there’s an option to export all media as well. That should do the trick.
Otherwise, you could export them using a script.
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks
I’m using Cloud+, but synchronization is sometimes incomplete.
Records are created, but data is sometimes not copied.
Clicking a field triggers synchronization.
Changes made via script are sometimes not synchronized.
After synchronization, the form icon sometimes reverts to the default.
Linked records may not appear in the link field.
The link itself is working.
Sometimes the record does not switch to the newly created record. (Since ver 1.0.15 or earlier)
Even after modifying the data, the list view does not visually sort. (Since ver 1.0.15 or earlier)
I’m not sure if this is the right place to be asking a subscription question but my guess is there will be a number of you have had the same question.
I have just upgraded from 5 to Pro. With 5 I was able to have Taps 5 installed on both my wife’s machine and my own using my registration number.
Now, however, my license has come through the App Store and is thus tied to my Apple ID and my wife’s machine is tied to her Apple ID.
Does this mean that now I will need to subscribe to two separate licenses tied to, our separate IDs?
Please understand this is absolutely not a moan. If I need to I’m more than happy to take another license ……………… but if I don’t I’ll be happier still!
DavidMac
Hi Michael,
If your data is in a form, you can use saved searches and filter for your condition. This way, only the relevant records are shown. When you look at them in multi-column list view, you can get your total costs.
Sometimes, I write scripts for reporting and display the result in an external browser.
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks
Grüezi,
Thanks for the code snippet, I’ll try it out later, including your ScriptHandler. By the way, while we’re on the topic of scripts, there might be a translation error in the German version. In the script overview, there’s a section with the little gear icon… it says “move to document,” but there is no “document” in the German overview. I think it should say “favorites,” and under “favorites” it should then say “switch to Formular.” I think the translation isn’t quite correct here.
Nice Week
Steve
You could try with following code snippet. Just add this at the beginning of your script. It adds the fetchRecordsWithMatch() function to the form object and presumably does a similar (or better?) thing than fetchRecordsForSearchTerm():
// form.fetchRecordsWithMatch
// Returns all records where the specified field matches the given value.
CDForm.prototype.fetchRecordsWithMatch = function(field_id, value){
return this.fetchRecords().filter(x => x.getFieldValue(field_id) == value);
}
And then instead of var auswahlRecoredsMonatsuersicht = formularMonatsuebersicht.fetchRecordsForSearchTerm('2026', feldJahrID); use var auswahlRecoredsMonatsuersicht = formularMonatsuebersicht.fetchRecordsWithMatch(feldJahrID, '2026');
This will return a record where all records are an extract match. This is what I have in my TF API Extensions script.
Viel Spass!
-
This reply was modified 5 months, 4 weeks ago by
Daniel Leu.
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks
Hi everyone,
Sorry to follow up again here,
I’m trying to load a dataset that I retrieve using fetchRecordsForSearchTerm('2026', feldJahrID). Unfortunately, there doesn’t seem to be any filtering happening at all. No matter what I enter as the search string, I almost always get nearly all records back.
If I search for “1”, I get 4 records. With “12” or “123”, I get 2 records. If I use “2”, I also get 4 records. Searching for “202” returns 4 records, and with “203” I get 3 records.
Either I completely misunderstand how the function works—in which case I apologize, because then, as usual, the problem is sitting between the keyboard and the chair—or something is definitely not working correctly here.
Thanks in advance for any information.
Steve
I’ll put the Script here because the Database has 12 MB so I can not upload ist
function Erstelle_Aktuellen_Monat() {
// Aktuelles Datum ermitteln
var aktuellesDatum = new Date();
var aktuellesDatumTag = aktuellesDatum.getDate();
var aktuellesDatumMonat = aktuellesDatum.getMonth() + 1;
var aktuellesDatumJahr = aktuellesDatum.getFullYear().toString();
// Formular Monatsübersicht mit benötigten Feldern
const formularMonatsuebersichtID = 'frm-e1192cd5b1724314b84fa584a02cca51';
const feldJahrID = 'fld-4c4ca5ba0da744e385e552ab5601fee0';
const feldMonatID = 'fld-9ccdf4162fed4721adaea441d9ff2d43';
const feldzugehörigeHausidID = 'fld-6841ad10151b477c86de0396fd186d75';
// Unterformular Zahlungseingänge mit benötigten Feldern
const formularZahlungseingaenge_id = 'fld-6fc140552dbc4a32a1dc078f7268d6e0';
const feldMieter_id = 'fld-ca6166213bf94662a7a7e04eff78b0d5';
const feldWohnung_id = 'fld-330fd8f304094d64bb99ddbfa4f9af8b';
const feldErwartete_einzahlung_id = 'fld-5f60efaf3c6043f2b008a65de6fd47c6';
// Formular Mietvertrag
const formularMietvertrag = 'frm-556cccd18f174e20982227e870784b87';
const feldMietvertragMieterID = 'fld-f9505864e6c048079fee1f640d13ba23'; // formatierter Name des Mieters
const feldMievertragWohnungID = 'fld-6779828c393c46dfb1e6d547b4c75f8d'; // Formatierte Whung (Haus + Wohnungsnummer)
const feldMietvertragDatumBeginnDesMietverhältnissesID = 'fld-7a5d9c2d2dd140fd85ebb7c4e7996fff'; // Ab wann gilt der Mievertrag
const feldMietvertragDatumEndeDesMietverhältnissesID = 'fld-af2bf0064540430d8c070d138a9a3ba3'; // Gilt dieser Vertrag noch
const feldMietvertragWarmmieteID = 'fld-1562739d1b1144c7ad250a0e7b379080'; // Das müsste auf dem Kontoauszug erscheinen
const feldMietvertragNebenkonstenSummeID = 'fld-3e8a8d04ce1944fb8eac5db9ede21391'; // Nebenkosten die mit gezahlt wurden (zur Gewinn berechnung benötigt)
// Weitere Variablen zum verarbeiten
var datensatzErstellt = 0;
// Monatsübersicht öffnen
console.log("Hole das Formular Monatsübersicht");
var formularMonatsuebersicht = document.getFormWithId(formularMonatsuebersichtID);
// Alle Datensätze holen, welche dem aktuellen Jahr entsprechen
console.log("Lese die Datensätze, für das Jahr: " + aktuellesDatumJahr);
var auswahlRecoredsMonatsuersicht = formularMonatsuebersicht.fetchRecordsForSearchTerm('2026', feldJahrID);
// Kontrollieren ob es Datensätze gibt
console.log("Kontrollieren ob es Datensätze gibt");
if (auswahlRecoredsMonatsuersicht.length == 0) {
// Es liegen keine Datensätze für das Jahr vor
console.log(auswahlRecoredsMonatsuersicht.length + " Datensätze gefunden");
// Da keine Datensätze für das Jahr vorliegen, kann für das aktuelle Haus ein Datensatz ertellt werden
} else {
// Es liegen Datensätze für das Jahr vor
console.log(auswahlRecoredsMonatsuersicht.length + " Datensätze gefunden");
// jetzt kontrollieren, ob diese auch für das aktuelle Haus sind
console.log("Kontrollieren ob einer für das ausgewählte Haus ist");
for (var index = 0, count = auswahlRecoredsMonatsuersicht.length; index < count; index++){
if (auswahlRecoredsMonatsuersicht[index].getFieldValue(feldzugehörigeHausidID) == record.getFieldValue(feldzugehörigeHausidID)) {
// Für das Haus gibt es bereits einträge
console.log("Einen Eintrag gefunden: " + auswahlRecoredsMonatsuersicht[index].getFieldValue(feldJahrID));
datensatzErstellt = 0;
} else {
// Für das Haus geibt es keine Einträge
console.log("Haus nicht gefunden");
// Neuen Datensatz erstellenb
datensatzErstellt = 1;
}
}
}
// document.saveAllChangesAndRefresh();
}