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 - 466 through 480 (of 2,989 total)
  • Author
    Search Results
  • #50086
    David Schwane
    Participant

    Photos are uploaded with various file names.

    Later, photos are downloaded using the built-in “Save Photo to Drive”

    Request is when photos are saved to drive, that they have the filename as one of the fields

    so instead of R-3220837-1321636325.jpg, it would be Fieldcatalogno.jpg

     

    would prefer to run script as a batch since I’m using built-in upload download functions, and once corrected, some sort of script that corrects future uploads.

    #50085

    In reply to: Open record as result

    Brendan
    Keymaster

    Hi Glen,

    Which part of the above maze do you mean when you say this? Searching records? You don’t need scripting to search records.

    #50082

    In reply to: New Tap Forms?

    andy bush
    Participant
    1. Oh nothing specific. JavaScript seems to allow for some neat data manipulation and I was wondering if there were plans to implement those abilities using menu systems instead of code. Really though I’m just excited to see what the new iteration of Tap Forms has to offer. It’s been so useful with my day to day goals and tasks. I haven’t found a program at this price point that comes close to what Tap Forms can do.
    #50080

    In reply to: Open record as result

    Glen Forister
    Participant

    I’ve always wanted this in a database, and I did have it in HanDBase in it’s early years, but it got lost for some reason in its later years and I severely miss it and asked about it soon after I joined.

    Is this a function that can be attempted without Script knowledge to make all the connections.  I can do that for simple scripts, but I wonder about the maze above.

    Hopefully.

    #50071

    In reply to: New Tap Forms?

    Brendan
    Keymaster

    Hi Andy,

    I am working on a new version of Tap Forms, but what is it you’re having troubles with in the current JavaScript editor? I’m not sure what you mean by “integrates a lot of the functionality that comes from knowing JavaScript”. That’s the loaded part of your question.

    Thanks,

    Brendan

    #50069
    andy bush
    Participant

    I love Tap Forms. It’s even inspired me to attempt Javascript but…uh… it’s not going well. Will there be a Tap Forms 6 that integrates a lot of the functionality that comes from knowing Javascript? I’ll keep plucking away at this language but hoo boy am I bad at programming. Watching the tutorials gives me a new empathy for my parents when I’m trying to show them how to open an email attachment.

    #50065
    Victor Warner
    Participant

    Thank you, Brendan,

    I did not realise the complexity involved.

    Why use a script rather than the Import Records function? I am transferring a series of records from FileMaker to TapForms (each with 4 to 7 forms). But I have to transfer them one record at a time.  The Import Records function involves a series of key presses or uses of the mouse (x 4 to 7 forms). Although automating these with Keyboard Maestro is possible, it still takes some time (as KM just automates what is done manually).

    Using a script essentially automates the process – and is far quicker.

    The date issue is resolved by searching and replacing the date in the CSV file with a regular expression before running the script.

    #50057
    Seth Godin
    Participant

    It took me a lot of tries to figure out this easy hack, so I thought I’d save others the trouble.

    If you’re going to print out forms, it tempting to drag fields into place on a blank canvas and then format each field and hit print.

    The problems arise if you have content where the text is of unknown length. You don’t know how much space to leave, and it ends up being holey.

    The alternative is to simply type the name of each field in brackets, like this:

    [name]

    [description]

    [price]

    Which will cause the fields to stay stacked, regardless of how much data is in each one, flowing longer ones and filling space for the shorter ones.

    And you can format it, not just with fonts and sizes.

    Go to TextEdit, build into every Mac

    Make a new doc

    Don’t miss this step: under FORMAT, hit MAKE RICH TEXT

    (this cost me two hours of poking around)

    now, go ahead and put your bracketed fields in, and you can change the layout all you like.

    Then, copy what you’ve got, and paste it back into your form.

    Done.

    Hope this helps.

    • This topic was modified 2 years, 2 months ago by Seth Godin.
    #50041
    Victor Warner
    Participant

    Some time ago, I got help with how to import the data from a CSV file with a script (see the post at https://www.tapforms.com/forums/topic/using-javascript-to-import-csv-files/#post-45422).

    One of the fields in the CSV contains a date in the form “01/01/1963”, and the aim is to import it into a date field in the form.

    Although the script runs fine and imports the data in the CSV, the date field is not imported.

    Because of the way the script was written, I do not know how to change the format of the date field so that the date field is correctly formatted for import.

    Help would be very gratefully received.

     

    #50008

    In reply to: Open record as result

    David Gold
    Participant

    Hi Daniel (or OP)

    I would like to be able to do this also. I have some code below (not sure exactly how to insert a code block). I’m trying to do what you’ve said in line 11 with function show_name. Basically I want to be able to search the name field and when I get a result (whether multiple or single by selection in prompter) it then opens the record in Tap Forms. Can you tell me how to make it work?

    Really appreciate any help as my javascript knowledge is limited.

    var myForm = document.getFormNamed(‘Test’);
    var records = myForm.getRecords();
    var search_term = Utils.copyTextFromClipboard();
    var result_count = 0;
    var results = [];
    var results_name = [];
    var selected;
    function show_name( name ) {
        form.selectRecord(name[0]);
    }
    function copy_result_multiple( name ) {
        if ( name == true ) {
            console.log( ‘Index:’ + results.indexOf( selected ) );
            console.log( results_name[ results.indexOf( selected ) ] );
            show_name( results_name[ results.indexOf( selected ) ] );
        } else {
            console.log( ‘Cancelled’ );
        }
    }
    function multiple_results( all_results ) {
        let prompter = Prompter.new();
        prompter.cancelButtonTitle = ‘cancel’;
        prompter.continueButtonTitle = ‘Show Name’;
        prompter.addParameter(‘Select Result ‘, ‘selected’, ‘popup’, all_results)
        .show(‘Multiple Results Found’, copy_result_multiple );
    }
    function search_records( haystack , needle ) {
    var name_id = ‘fld-1acb38c0b51b44698849501407b51722’;
        var rec;
        for (rec of haystack) {
        var name = rec.getFieldValue( name_id );
        if (name && name.includes( needle ) ) {
                results.push( rec.getFieldValue( name_id ) );
                results_name.push( rec.getFieldValue( name_id ) );
                result_count++;
            } else {
            if (! name) {
            console.log(“Empty field: ” + rec.getUrl());
            }
            }
        }
        if( result_count == 0 ){
            Utils.alertWithMessage(“No Results”, “No results were found for the search term: ” + needle);
        }else if( result_count > 1 ){
            //multiple results
            multiple_results( results );
        }else{
            //single result
            show_name( results_name[0] );
        }
    }
    search_records( records , search_term );
    #50000
    Paul Hirst
    Participant

    If I’ve written a script to conduct a search and then at the end want to open the record that is the result of the search is there a way to do this? I have found the ability to print the result but that brings it up as a page to print rather than opens up the record?

    #49998
    David Gold
    Participant

    I’ve had a go at it cutting and pasting from some other scripts but can’t work out why it’s not working. Am getting an error in the console saying:

    var myForm = document.getFormNamed(‘Boral’);
    var records = myForm.getRecords();
    var search_term = Utils.copyTextFromClipboard();
    var result_count = 0;
    var results = [];
    var selected;

    function copy_name( name ) {
    Utils.copyTextToClipboard( name );
    }

    function multiple_results() {

    var joined = ‘–multiple_matches–‘;
    var res;
    for (res of results) {
    joined = joined +
    res.name;
    }
    copy_comments( joined );
    }

    function search_records( haystack , needle ) {

    var name_id = ‘fld-1acb38c0b51b44698849501507b51722’;
    var rec;

    for (const rec of haystack) {
    if ( rec.getFieldValue( name ).toLowerCase().includes( needle.toLowerCase() ) ) {
    results.push( { location: rec.getFieldValue( name_id ) } );
    result_count++;
    }

    }

    if( result_count == 0 ){
    console.log( ‘No results found!’ );
    }else if( result_count > 1 ){
    multiple_results();
    }else{
    copy_name( results[0].name );
    }

    }

    search_records( records , search_term );

     

    • This reply was modified 2 years, 3 months ago by David Gold.
    #49995
    David Gold
    Participant

    I don’t know JavaScript so I was wondering if someone could help me with a simple script for the iOS app that does a search of a database for a term called “input” of a database called Boral with a form called Boral Data and searched a field called Name (I can add the field ID where it is needed)?

    Any assistance would be much appreciated.

    #49991

    In reply to: Calc fields / Tab

    Brendan
    Keymaster

    Although you could do it with a Script field instead of a Calculation field:

    function Script() {
    
    // Replace with your own code
    var hello_world = "Hello\t\t\tWorld!";
    return hello_world;
    
    }
    
    Script();
    #49979
    Glen Forister
    Participant

    Earlier this week I made the same complaint, although a much longer explanation and description, but when I posted it, it disappeared, I thought maybe censored, but probably a glitch took me out.

    Yes, there needs to be an addition to the settings for the main program to enlarge all the program’s fonts.  I had to add an extra screen to my 14″ MacBook Pro because of this for all my programs, and it has helped a lot, but wasn’t enough help for Tap Forms.  I often have to work with my total screen zoomed in via Ctrl / touchpad sweep 2 finger sweep up to magnify to a point where I am comfortable.

    And, yes, this is a good program at a great price which almost replaces HanDBase which I had to move off of when Dave decided to quit.

    Thanks.

    • This reply was modified 2 years, 3 months ago by Glen Forister.
Viewing 15 results - 466 through 480 (of 2,989 total)