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,039 total)
  • Author
    Search Results
  • #53727
    Glen Forister
    Participant

    The picklist using a script (“Red Blue Green”) works, but using it on my iPhone 16 I discovered I can’t use it because the little picklist icon to touch to get the list is not there. No way to get the list.

    Just for fun I put another field with a normal picklist and that works as expected with the icon at the right and it pops up the choices.

    I guess it is because the filed is a Script type and that type doesn’t have a picklist option???
    So, I guess that method doesn’t work on the iPhone?

    #53719
    Brendan
    Keymaster

    I edited your post to make the code more readable. Just put a back-tick around it. One at the beginning and one at the end. The forum will format the code to make it easier to read.

    Anyway, I don’t see anything wrong with your script.

    Try putting a console log message before: record.getFieldValue(year_id) to see what you get:

    console.log(record.getFieldValue(year_id));

    #53713

    In reply to: Pick lists w/ comment

    Glen Forister
    Participant

    First, I couldn’t past into that window so I had to type it in. Then later I discovered pasting from my keyboard doesn’t work, but the edit menu “paste unformatted” does the job. So, pasting your script in did work.

    Thanks for the patience. That works just like I wanted. Sorry, I just don’t have time to keep the skills of scripting. Wish I did – it can be lots of fun.

    #53702

    In reply to: Pick lists w/ comment

    Daniel Leu
    Participant

    There are many typos in your script. Please copy it from https://www.dropbox.com/scl/fi/kxvy7lpsepka5atnd8ymk/picklist_value.txt?rlkey=idzgqadkaba4co05o2x49h87i&dl=0. I already added your field id. So it should run just like this.

    Oh, don’t forget to set the return type to number.

    I run the script in one of my forms to verify that it works.

    Cheers, Daniel

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

    #53700

    In reply to: Pick lists w/ comment

    Glen Forister
    Participant

    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.

    #53674

    In reply to: Pick lists w/ comment

    Daniel Leu
    Participant

    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 1 week, 5 days ago by Daniel Leu.
    • This reply was modified 1 week, 5 days ago by Daniel Leu.

    Cheers, Daniel

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

    #53670
    Glen Forister
    Participant

    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?

    #53669
    Mark Moran
    Participant

    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 1 week, 3 days ago by Brendan.
    #53646
    Brendan
    Keymaster

    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.

    #53645

    In reply to: Missing something

    Daniel Leu
    Participant

    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

    #53644
    Yutaka Kitamura
    Participant

    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.

    #53642

    Topic: Missing something

    in forum Script Talk
    Glen Forister
    Participant

    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.
    #53636
    Daniel Leu
    Participant

    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

    #53588
    Yutaka Kitamura
    Participant

    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)

    #53584
    David Macdonald
    Participant

    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

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