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 - 1 through 15 (of 3,049 total)
  • Author
    Search Results
  • Brendan
    Keymaster

    Hi Yutaka,

    You can control whether or not forms each have a separate split width or not on the Settings screen.

    I’ll look into the Script menu issue.

    Thanks,

    Brendan

    Yutaka Kitamura
    Participant

    When I click a link field to jump to the parent record, the split position between the record list and the record detail view, or between the form list, does not change to the position set in the destination form.

    Also, the script menu does not change to that of the target form.
    (the Form Inspector does change to the destination form)

    #53916
    Brendan
    Keymaster

    It works for me.

    Are you using curly quotes there or straight quotes in your JavaScript? They need to be straight quotes.

    #53911
    Phil Norton
    Participant

    I have a complete script to look up a reference form and return a result but if I input a value that I know is there – Brat. it gives me the error
    Intergeneric Reference: SyntaxError: Unexpected identifier ‘found’. Expected ‘)’ to end an argument list., line:1

    If If just input Brat without the “.” It gives me this:
    Intergeneric Reference: ReferenceError: Can’t find variable: Brat, line:(null)

    This is a test script that gives the same result:

    function lookupIntergeneric() {
    var refForm = document.getFormNamed(‘Intergeneric Reference’);
    return refForm ? ‘Form found’ : ‘Form not found’;
    }
    lookupIntergeneric();

    #53905

    In reply to: Global function

    Daniel Leu
    Participant

    Yes, there’s the runScriptNamed('common functions') command. This will execute the named script. If such a script only contains functions and definitions, then they will be directly accessible from you script. But if the script contains a function call, it would be executed too.

    To prevent that, I use following structure at the end of the file:

    if (!scriptName == "common functions"){
       // function call to entry point of script
       main();
    } else {
       console.log("Script " + scriptName + " loaded");
    }
    

    For a document script use document.runScriptNamed('common functions') and for a form script use document.getFormNames('script form').runScriptNamed('common functions').

    As you see, you can put scripts in a common form where you can pull them from. I do this with my scriptHandler helpers.

    Cheers, Daniel

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

    #53898

    Topic: Global function

    in forum Script Talk
    Steve-Kai Vyska
    Participant

    Hi, everyone and happy easter,

    Using piclists, you can set them to to Document, so that you can access them from every form. is there somehow a possibility to make the same with functions?

    i have several function, which I need to use in several forms. actually I copy them to each script I need it in. Is there some way to declare it onetime and use from every script?

    Greetings 🐣

    Steve

    Daniel Leu
    Participant

    I’ve moved things around. Here’s the updated link: https://lab.danielleu.com/tapformspro/tips-tricks/calling-tap-forms-pro-scripts-from-python-and-getting-results-back.html

    • This reply was modified 2 weeks, 1 day ago by Daniel Leu.

    Cheers, Daniel

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

    #53892
    Mark Moran
    Participant

    I’ve attempted to write an ebay posting interface to my Tap Forms Pro DB for posting items for sale off and on. I know just enough javascript to get myself in trouble. AI is sometimes a hinderence rather than a help. But it’s telling me the following. It’s recommending running a local js file because tap forms can’t access the ebay api directly?? Is it correct?

    My question to claude:
    can the tap forms pro script just access the ebay api directly?

    No — the blocker is that eBay’s API requires an Authorization: Bearer <token> header on every request, and Tap Forms Pro’s HTTP methods can only set Content-Type. There’s no way to pass custom headers:

    // These are ALL the HTTP calls Tap Forms can make:
    Utils.getJsonFromUrl(url)
    Utils.getTextFromUrl(url)
    Utils.postJsonToUrl(json, url)
    Utils.postContentToUrlWithContentType(content, url, contentType) // ← only Content-Type, nothing else

    eBay also requires the OAuth token refresh call to use Authorization: Basic base64(clientId:clientSecret) — also a custom header.

    The local server exists purely to add those headers. It’s a thin shim:

    Tap Forms → POST http://localhost:3721/post-to-ebay (no auth needed, local only)
    server.js → POST https://api.ebay.com/&#8230; (adds Authorization: Bearer <token>)

    If Tap Forms ever adds a Utils.postWithHeaders(url, headers, body) method, you could go direct. Until then, the proxy is the only path.

    Daniel Leu
    Participant

    In case anyone uses Python and wants to improve the TFP workflow. Here’s an example of how to call TFP and get results/data back using a JSON object.

    https://lab.danielleu.com/tapformspro/tips-tricks/posts/calling-tap-forms-pro-scripts-from-python-and-getting-results-back.html

    • This topic was modified 2 weeks, 2 days ago by Daniel Leu.
    • This topic was modified 2 weeks, 2 days ago by Daniel Leu.

    Cheers, Daniel

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

    #53869
    Paul Wirth
    Participant

    Hi, I bought a subscription to TF Pro several weeks ago, but I have been unable to get iCloud+ sync working to my iPhone.

    I have a 75MB TF Pro database document on MacOS that I’ve synced to iCloud+. When I attempt to download it to TF Pro on my iPhone, it never completes. The Documents view shows it maxing out anywhere between 6MB and 37MB.

    TF Pro on the mac indicates the sync is fully complete, though. I have plenty of room on the device and in iCloud. This has been happening since before v1.1, and I’m currently on v1.2.

    I’ve tried deleting the database from the iPhone, disabling iCloud+ sync and removing the database from iCloud+, and resyncing, but still no luck.

    #53831
    Daniel Leu
    Participant

    Great that you found a solution, Steve.

    You could try to run subformRecord.refreshCalculations() in your script.

    Cheers, Daniel

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

    #53829
    Steve-Kai Vyska
    Participant

    Hi Brendan,

    ok I found a work around using Daniels Idea:

    1. When creating the Entrys, there is a new field, which ist written by a script having all Data to separate the Entrys in it,

    2. the parent Form has two new field too, which are created by a script and are used for the join criteria.

    The only manko about this is, that you have to go to the subform and change Data there, so that the script there can rewrite the field. When changing the record in the parent form the script in the subforms seems not to run. but I can live with that :)

    Thanks for the help you two

    Steve

    #53811
    Steve-Kai Vyska
    Participant

    Hello everyone,

    Is there a way to link a form using two criteria?
    Here’s what I mean:
    Let’s say you have a form called “Invoice”. It contains three fields:

    Date
    Amount
    Paid

    Now I would like to place this form under a customer. That part works fine, because when I create a new payment, Tap Forms automatically handles the linking.
    However, I would like to include this form twice:

    Once for “Payment pending”
    Once for “Invoice paid”

    As soon as the “Paid” field is checked, the entry should appear in the second subform. In principle, this would require two conditions:

    The customer
    “Paid” is set or not

    Currently, I’m working around this by using a script to read and reassign the data, but that means I have to delete one record and recreate it in the other place. In theory, this could be solved more cleanly with an additional “AND” condition, without moving data around.
    Thanks in advance for any suggestions—or for pointing out what I might be doing wrong.

    Best regards,

    Steve

    #53802

    In reply to: Archiving records

    Mark Moran
    Participant

    For my Plants database I use a status field: Current, Archive. Then I use saved searches, that always start with Status = Current.(unless, of course, I’m looking for archived plants.)

    Here is a link to a script that does what I think you want. You need to read through to the last posts, which detail changes to script to work with TapForms Pro

    https://www.tapforms.com/forums/topic/script-to-copy-records-from-one-form-to-another/

    Many thanks for your reply. I’m doing something similar now with the tags current/archive. The problem is I already have a ton of save searches, eg. Coin type = Lincoln Cent, Coin Type = Jefferson Nickel, etc. then to add another each of those for both current and archive I’ll have 25 to 30 saved searches.

    Going to look at the copy to new form script.

    #53801

    In reply to: Archiving records

    Cliff Richardson
    Participant

    For my Plants database I use a status field: Current, Archive. Then I use saved searches, that always start with Status = Current.(unless, of course, I’m looking for archived plants.)

    Here is a link to a script that does what I think you want. You need to read through to the last posts, which detail changes to script to work with TapForms Pro

    https://www.tapforms.com/forums/topic/script-to-copy-records-from-one-form-to-another/

Viewing 15 results - 1 through 15 (of 3,049 total)