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 - 106 through 120 (of 3,148 total)
  • Author
    Search Results
  • #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 7 months, 1 week 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 7 months, 1 week ago by Daniel Leu.
    • This topic was modified 7 months, 1 week 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/

    #53800
    Mark Moran
    Participant

    Hi everyone,

    I’m looking for some architectural advice for my coin collection database. Currently, I have two forms:

    Coins: My main inventory.

    eBay Sales: Linked to the Coins form via a Link to Form field (1:1 relationship).

    The Problem:
    When a coin sells, I mark it with a “SOLD” tag. I then use a search filter to hide these items. However, managing this becomes cumbersome when I want to apply additional filters; trying to balance “Include” tags and “Exclude” tags simultaneously in the search rules is proving difficult.

    My Idea:
    I’m considering creating a third form called Sold Coins. I would run a script to copy the record data from “Coins” to “Sold Coins” once a sale is finalized, then delete the original.

    The Question:
    Is moving records between forms a standard practice in Tap Forms, or is there a better way to handle “Archived” records that keeps the database clean without breaking my eBay sale links?

    #53792
    Steve-Kai Vyska
    Participant

    Hello everyone,

    i have a very simple script to get the ID of a Record:

    function Auto_Script_Gezahlt() {
        
        return record.getId();
    }
    
    Auto_Script_Gezahlt();

    This scripts work in all forms, except this one where I get an Error whenever I start it in the script window. the problem is the variable record, which comes from the program. I have put pictures in here to illustrate what it is doing However the script works in the form correct, but it ist not possible to check something in it, because of the error.

    Have a nice evening

    Steve

    Attachments:
    You must be logged in to view attached files.
    Ray Kloss
    Participant

    My sister needs information from a database I created which has characters, numbers and images (up to 3). When I export the info as a civ, the images are only noted by their names. I can include the images for export, but then they go into a file. Is there a way I can export the images with something other than just the name, or is there a script to connect them?

    #53765
    Glen Forister
    Participant

    That is less work than I was going to do. I looked at those date propterties & descriptions, but I wasn’t exactly sure what they would produce or what they could take.
    Thanks.

Viewing 15 results - 106 through 120 (of 3,148 total)