Tap Forms app icon half
Tap Forms Forum text image
Blue gradient background

Exchange tips and ideas with the Tap Forms community

Search Results for 'script'

Viewing 15 results - 16 through 30 (of 3,100 total)
  • Author
    Search Results
  • #54205
    Paul Cotton
    Participant

    Re 10 – scripts triggering on field change: this was user error and Brendan provided the solution via email.

    I was using getId rather then explicitly identifying the field in the script itself:

    mine that didn’t work correctly:

    var currval=record.getFieldValue(form.getFieldNamed(“Currency”).getId());

    Brendan’s solution that works great:

    var currval=record.getFieldValue(‘fld-6cc122549b004a09b0e21e8b4f76b313’);

    #54204

    In reply to: ordinal day?

    Brendan
    Keymaster

    Here’s a JavaScript function which will give you the day of the year:

    const dayOfYear = date => {
        const myDate = new Date(date);
        const year = myDate.getFullYear();
        const firstJan = new Date(year, 0, 1);
        const differenceInMillieSeconds = myDate - firstJan;
        return (differenceInMillieSeconds / (1000 * 60 * 60 * 24) + 1);
    };
    
    const result = dayOfYear("2019-2-01");

    For the time of day, you can call myDate.getHours(), myDate.getMinutes(), myDate.getSeconds()

    #54201

    In reply to: ordinal day?

    Glen Forister
    Participant

    I don’t remember what form I was using when I was given that instruction (I keep that now) in my notes (questions TapForms). It could have been a script.
    I don’t care how I do it, you can see what i’m trying to do which is given the input from “Date & Time” in the first col., I want a day of year + a decimal for the time of day (hours & minutes).

    This is so I can graph Date & Time against what happens on that event which is from a number from 1-6.

    Thanks for looking.

    #54199
    Paul Cotton
    Participant

    Re 9 and updating latest date, in creating an example from scratch I realised that “recalculate formulas and scripts for all records” from the active form in single col view (rather than multi-col view) does work. I had completely missed that button on single-col view for some reason.

    I had an exact copy of the ipad file I brought back, tried it with that and it worked fine so can scratch that one from the list.

    • This reply was modified 1 week, 5 days ago by Paul Cotton.
    #54196

    In reply to: ordinal day?

    Brendan
    Keymaster

    Where did you get the info for the DAYOFYEAR() function? It is not a function I have in the formula editor.

    Have you tried JavaScript to generate that?

    Thanks,

    Brendan

    #54189
    Daniel Leu
    Participant

    In another application, I used a checkmark field along with a field script to do some action. So you could have the same, once you set a checkmark field, the field script is triggered and that would clear all other checkmark fields.
    Now with your main script, you can locate the two records in their respective forms that have the checkmark field set and populate your third form.

    Cheers, Daniel

    ---
    See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks

    #54179
    Paul Cotton
    Participant

    Re 9), I see that the ipad element makes no difference. I edited the subform direct on ipad as I couldn’t create a new subform record from within the parent form.

    On macos, I just tried adding a record direct into the form that is used as a subform and that didn’t update when I viewed the parent form either.

    It didn’t update when I tried multi-column > “recalculate formulas and scripts for all records”.

    Some tests did update using the “recalculate formulas” in the parent form – but one time it didn’t.

    Sadly that method isn’t practical as it requires my knowing which records are out of sync.

    Re the forum post edit issue, I see that is just the result of the short editing time window.

    • This reply was modified 2 weeks, 1 day ago by Paul Cotton.
    • This reply was modified 2 weeks, 1 day ago by Paul Cotton.
    • This reply was modified 2 weeks, 1 day ago by Paul Cotton.
    • This reply was modified 2 weeks, 1 day ago by Paul Cotton.
    #54175
    Paul Cotton
    Participant

    I’m a recent convert to Tap Forms Pro for macos. I originally used Bento, then moved to Filemaker when they shut that down, and have spent years setting up systems for various things in that. I’ve been unhappy with Claris as a company for years now, but felt locked in with no hope of finding a workable solution to break away. TFP has provided me with a way to do just that.

    I am extremely happy with TFP, but I encountered some issues in setting things up – some feel like bugs, some are no doubt just new user error/ignorance.

    1) In layout mode, line doesn’t layer on top of other shapes, text or images

    2) cmd c + cmd v page elements screws up editing, example:
    add a few fields to layout
    add rectangle to layout
    layer list: clicking in list selects the correct elements in layout
    cmd c + cmd v to duplicate rectangle
    note that it doesn’t create a new layer for the duplicate
    selecting in the layer list is now out of sync with the elements in the layout
    going to form view removes the duplicate rectangle
    back to layout view and delete the original rectangle – an entry in layers remains
    go to form view and the duplicate rectangle is visible again

    3) after making a backup of a password protected file via file>backup, on re-opening, the show/hide forms list, display form/layout inspectors, and advanced search buttons are all disabled (can still use drop down menu for these functions)

    4) File size seems massive relative to data size. Importing relatively modest csv’s has ballooned the TPF file-size, eg I have a csv with 17,191 records, 3.7MB total, and each record is ~200 characters long. Importing that increased TFP file size by 72.5MB, even after doing a “rebuild search index”. This is an example record:

    “max 5-letter word”,””,””,””,”4 characters”,””,””,”email address”,”email address”,”max 60 character term”,”max 60 character term”,”date”,”USD”,”number”,”date”

    A different 1MB excel file increased TFP by 10MB. The filemaker database I used was 65MB, including more data than I imported. The two equivalent TFP files total ~250MB.

    5) Notes fields do strange things with their margins. When I type to the very right-side edge of the notes field, all of the text jumps to hard-left, removing the lefthand margin. I have to move my cursor close to the left-side edge of the notes field and drag left to move the text back right. Dragging cursor right near right-side edge also moves the text left.

    6) A calculation field using + for multiple number fields sums fields until it hits an empty field, then treats that sum so far as text and concatenates the sum so far with the fields after as if text. Is there any way to either have empty number fields treated as 0, or to bulk change all empty fields to 0?

    7) Sorting text fields interprets the whole number portion at the beginning of a field rather as characters eg 1word,2word,10word, rather than 1word, 10word, 2word – is there any way to stop this?

    8) In note fields set to plain text and a specific font/size, new text defaults to font family=no value, typeface=””, and size=0, rather than the font set in layout view. Also, it does still recognise and store changes of font/style made in sections of the text.

    9) I have a form with a subform. The subform has records with dates, the main form has a calculation field that shows the latest date from the subform. This works fine in macos. I used TFP on an iPad, entering data into the subform direct. On reload to mac, it didn’t update the latest date fields when viewing those records.

    10) I have a text field that uses a pick list and a script field that listens for changes to that text field. When I change the value, the script isn’t executed – it only executes when I click on the bottom-left “recalculate formulas” button. I looked at the Books Library template and the Sortable Title script field in that behaves the same way for me.

    #54172
    Brendan
    Keymaster

    Hi Steve,

    If you double-click on the record number, then that record becomes the selected record and can be referenced by using record in your script. But there’s no tracking from JavaScript of what child record is merely selected from the spreadsheet view on a Table or Link to Form field.

    What are you trying to accomplish?

    Thanks,

    Brendan

    #54171
    Steve-Kai Vyska
    Participant

    Hello everyone,
    I have a form that contains a subform. In this subform, you can select a specific row by clicking the number at the front, for example to delete it.

    Is there any way to get the ID of the selected record from the main form? Using a script or a script field would both be fine.

    Best regards,
    Steve

    #54143
    Daniel Leu
    Participant

    My script works with Tap Forms Pro. Here’s an example using my script showing just the EXIF data of an iPhone image:

    5/19/26, 11:19:12 AM / new form / First photo date
    {
        "WhiteBalance": 0,
        "PixelYDimension": 640,
        "LensMake": "Apple",
        "OffsetTimeOriginal": "-07:00",
        "MeteringMode": 3,
        "ColorSpace": 1,
        "LensModel": "iPhone 13 Pro back triple camera 5.7mm f/1.5",
        "DateTimeDigitized": "2026:05:16 20:00:32",
        "ExposureProgram": 2,
        "OffsetTimeDigitized": "-07:00",
        "ExifVersion": [
            2,
            3,
            2
        ],
        "SubsecTimeDigitized": "392",
        "ExposureBiasValue": 0,
        "ISOSpeedRatings": [
            100
        ],
        "LensSpecification": [
            1.5700000524520874,
            9,
            1.5,
            2.799999952316284
        ],
        "Flash": 16,
        "SubsecTime": "392",
        "CompositeImage": 2,
        "DigitalZoomRatio": 3,
        "SceneType": 1,
        "ApertureValue": 1.1699250021066825,
        "BrightnessValue": 2.820906607251797,
        "DateTimeOriginal": "2026:05:16 20:00:32",
        "FocalLength": 5.7,
        "ExposureMode": 0,
        "SensingMethod": 2,
        "FNumber": 1.5,
        "OffsetTime": "-07:00",
        "PixelXDimension": 480,
        "ShutterSpeedValue": 5.906515543357788,
        "FocalLenIn35mmFilm": 77,
        "SubjectArea": [
            1685,
            1265,
            747,
            735
        ],
        "SubsecTimeOriginal": "392",
        "ExposureTime": 0.016666666666666666
    }
    

    Cheers, Daniel

    ---
    See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks

    #54140
    Daniel Leu
    Participant

    Oh, my apologies. Tap Forms 5 doesn’t expose the photo metadata, so this script won’t be able to help you. Unfortunately, I don’t have a solution for you either.

    Cheers, Daniel

    ---
    See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks

    #54138
    FrAnksch
    Participant

    Thank you so much for your help, Daniel!

    I copied your script into a script-field “EXIF-date” and used the fields “photo” as source and “date” as target.

    Unfortunately I get the following error:

    EXIFdate: TypeError: photos[0].getExifData is not a function. (In ‘photos[0].getExifData(photos[0])’, ‘photos[0].getExifData’ is undefined), line:(null)

    My photo has definitely EXIF data.

    Am I doing something wrong or is there anything with the code?

    btw: I´m on TF5 on iOS 26.5 and macOS Tahoe 26.2 (if this is relevant)

    Thank you!

    • This reply was modified 3 weeks ago by FrAnksch.
    #54134

    In reply to: Greetings from France,

    Luc VIENNE
    Participant

    Hello Bredan,

    No, I don’t want to stay on a particular version of macOS because of one piece of software. No, I don’t want to pay such an expensive subscription.

    yes, I understand that you spent a year developing the PRO version; no, I don’t understand why you can’t disable the PRO features to make a lighter version, or else there’s a catch (as we say in France) and the PRO version is just the original version rewritten, which certainly required a lot of work.

    So unfortunately, I see that you’re not open to other suggestions, so I’m going to leave you for other, less expensive applications.

    I hope you succeed, but I have my doubts… Thank you for replying and reading. Cheers. Luc

    #54132
    Steve-Kai Vyska
    Participant

    Thanks for the suggestion.

    I tested this with a script that writes values into the related subform records.

    The script fills/updates the subform records without calling refreshCalculations() on those child records. After calling saveAllChangesAndRefresh(), the new values are visible in the subform, and the calculation fields inside the subform records are updated correctly.

    So this part works as expected.

    The remaining issue is the parent record.

    The parent record has a calculation field that depends on the calculation results from the related subform records. These subform calculation values are already correct and visible, but the parent calculation field still does not update.

    I also tried the recommended call on the parent record:

    
    function Test() {
        record.refreshCalculations();
    }
    
    Test();

    Unfortunately, this does not change the parent calculation either.

    So the subform records and their own calculations are refreshed correctly. The problem is that the parent record does not seem to recalculate based on the updated subform calculation values, even after calling refreshCalculations() on the parent record.

    Have a nice Sunday

    Steve

Viewing 15 results - 16 through 30 (of 3,100 total)