Script Field does not apply Currency Accounting format

Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch Forums Using Tap Forms Pro Script Field does not apply Currency Accounting format

Viewing 4 reply threads
  • Author
    Posts
  • May 8, 2026 at 4:10 PM #54075

    Steve-Kai Vyska
    Participant

    Hi Everyone,

    I may have found a problem with Script Fields and number formatting in Tap Forms Pro.

    I have a Script Field in a form that returns a numeric value from JavaScript.
    I tested different variants, for example:

    – returning a parsed integer directly
    – returning a rounded number
    – returning a plain numeric value without formatting

    Example idea:

    return 12050;

    The field settings are:

    – Number Format: Currency Accounting
    – Currency: Czech Koruna
    – Decimal Places: 2

    My expectation was that Tap Forms would display the returned numeric value using the field’s configured formatting, for example with the correct currency/accounting display.

    But the formatting does not seem to be applied as expected.
    It looks like the Script Field output is shown more like a raw value than like a properly formatted currency field.

    I also tried simplifying the script as much as possible, so this does not seem to be caused by custom formatting logic inside the script itself.

    Question:
    Is this expected behavior for Script Fields?
    Or should a Script Field that returns a numeric value inherit and display the configured number/currency formatting of the field?

    If needed, I can provide a minimal reproduction example.

    Thanks!

    Steve

    May 8, 2026 at 5:22 PM #54077

    Brendan
    Keymaster

    Hi Steve,

    Make sure you set the Result Type of your Script Field to Number (bottom-left of the Script Editor window).

    Then the formatting options should work.

    Thanks,

    Brendan

    May 9, 2026 at 12:28 AM #54078

    Steve-Kai Vyska
    Participant

    Hi Brendan,

    I must admit, that I have never realized this little field down there and of course it was set to TEXT 🤦‍♂️ Yes it is working now. In the meanwhile I have build a working Rent-Administration system with your Tap Forms pro and it is working really really good Thanks for the good work you are doing here making it a great product 👏

    I really must say that in the whole system there are little work arounds you can use to make it all Work as you want. But one Think is missing 😂 Write something to a normal text File via script 😂 actually I’m using the copyTo Clipboard and put it via Editor in the file bat that would be the last missing Part for me 👍

    Have a nice Weekend 🙋‍♂️

    May 9, 2026 at 8:55 AM #54079

    Daniel Leu
    Participant

    Brendan enhanced the API over the years and file handling was improved in Tap Forms Pro: Utils.writeTextToUrl(text, fileUrl). So you can do const status = Utils.writeTextToUrl('Hello world!', 'file:///Users/daniel/Desktop/test.txt');. Please note that fileUrl path must enabled using the Script Access Folder setting.

    Cheers, Daniel

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

    May 9, 2026 at 6:40 PM #54081

    Brendan
    Keymaster

    There’s also let fileHandle = Utils.openTextFileAtUrl('file:///Users/daniel/Desktop/test.txt') and then in a loop use Utils.appendTextToFileHandle('Hello World', fileHandle); and then after the loop use Utils.closeFileWithHandle(fileHandle) which would be useful for writing a lot of data to a file without having to build up a big string in memory.

Viewing 4 reply threads

You must be logged in to reply to this topic.