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 - 481 through 495 (of 3,012 total)
  • Author
    Search Results
  • #50142
    Glen Forister
    Participant

    I may have missed something.  I had exported in TAB but the file is .csv, so I think I chose that item.

    The import did happen, but now instead of a few added records, the records doubled.  Oops, now I have every record with it’s copy.

    How do I prevent doubling the records, and just update the records that are there?

    I guess I’ll save my new Form with the added fields and JavaScript into a Form Template file and start a new Form using the template and import the records to get to where I want to be?

    Question:  If I need to work on the new form some more, how do I update the records from the original working Form into the new Form without doubling it again?

    #50137
    Glen Forister
    Participant

    I finally had the time to do the

    Copy Form to a new Form in the same document.
    I then made my changes in the copied Form and added 2 fields to hold the Java Scripts.

    I then Exported my revised data in the original Form into a CSV file.
    I also had to rename a couple fields when I imported into a spreadsheet.
    I also had to the delete the data in one field so the Javascript could work properly.

    I then imported the altered CSV file into the new copied Form with the desired Form changes.
    Unfortunately, the changes didn’t happen and the added records didn’t get imported even thought the feedback and temperature graphic showed it was happening.

    Basically nothing happened and the new Form didn’t get updated.

    What is the correct process if it isn’t the one detailed below in a previous posting?

    =======  Process determined in an earlier posting  ================================

    Ok, so really, the only safe way to create a copy to work on changing the Original Form, is:

    1. Duplicate the Form.

    2. Work on the changes wanted, including renaming fields, moving fields, adding fields and all the changes in properties required in the Duplicate Form.

    3. Export data as a CSV file from the Original Form which you are still adding data to while work on the Duplicate Form was proceeding.  Make sure the Export Record IDs option is turned OFF. If you don’t, Tap Forms will just update the existing records when you re-import the CSV file.

    4. Import that data from the Original Form into the new Duplicate Form.

    5.  During the Import process, make sure the data in the old Form is directed to the correct field in the Duplicate Form.  I haven’t done this much in TF, so I don’t know how much ability there is to make sure the previous is possible, but I’m sure you made that possible.

    Thanks for clarifying the traps involved with the Archive file.  Basically, don’t use it for this purpose or it will prove dangerous to you eventually.

    Let me know if I’m correct or need to change something.

    #50130

    Topic: Attach PDF

    Glen Forister
    Participant

    I see how to attach a picture, but can I attach a PDF anywhere?  I don’t see any mention in the descriptions of the fields.

    Is the solution to convert PDFs to pictures?

    #50117

    In reply to: testing scripts

    Glen Forister
    Participant

    I finally had the time to do the

    Copy Form to a new Form in the same document.
    I then made my changes in the copied Form and added 2 fields to hold the Java Scripts.

    I then Exported my revised data in the original Form into a CSV file.
    I also had to rename a couple fields when I imported into a spreadsheet.
    I also had to the data in one field.

    I then imported the altered CSV file into the new copied Form with the desired changes.
    Unfortunately, the changes didn’t happen and the added records didn’t get imported.

    Basically nothing happened and the new Form didn’t get updated.

    What is the correct process if it isn’t the one detailed above in the previous posting.

    #50116
    Glen Forister
    Participant

    You define “Note” field = large amounts of text. .

    You define “Text” field = movie title or short description.

    I imported from another DB as CSV file and notice that some records in the “Text” field contain a fair amount of text, much more than “movie title or short description”.

    I wonder how many characters a Text field can contain before it doesn’t work anymore.   So, should I convert many of my Text fields to Note fields because they have much more than “short description”?

    The downside of using the Note field a lot where a Text field would suffice would increase the size of the database considerably I would assume.  So, the question about how many characters is a valid question and an important one.  Other databases do define this information in character numbers allowed before it is chopped off.

    #50104

    In reply to: Javascript Help

    Daniel Leu
    Participant

    In my case, the checkbox field is called ‘selected’. You just need to assign the field id of field Added_to_VR-Mailing on line 3 of the code below.

    // This script selects all records
    
    function selectAll(){
    const selected_id = 'fld-xxxx';
    var records = form.getRecords();
    
    for (var index = 0, count = records.length; index < count; index++){
    var myRec = records[index];
    myRec.setFieldValue(selected_id, true);
    }
    
    document.saveAllChanges();
    }
    
    selectAll();

    The code loops over all records and sets the checkbox value to true.

    • This reply was modified 2 years, 4 months ago by Daniel Leu.
    • This reply was modified 2 years, 4 months ago by Daniel Leu.
    • This reply was modified 2 years, 4 months ago by Daniel Leu.

    Cheers, Daniel

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

    #50103

    Topic: Javascript Help

    in forum Script Talk
    Peter Chamalian
    Participant

    I have a form with a simple checkbox.  I want to start by checking that box for all my records.  Not being a Javascript coder, I need some help.

    The field name to check is Added_to_VR-Mailing.

     

    Thanks!!

    #50088
    Brendan
    Keymaster

    Hi David,

    I was just playing around with writing a script for you, but then realized that it wouldn’t work. When you add a photo to a record in Tap Forms, the data is stored in two places for the photo. The record holds a dictionary with the photo field’s metadata, including the filename. But also, the record’s internal representation in the CouchbaseLite database holds a reference to that photo too. It uses the filename to hold that reference. So if you rename the value in the photo field’s metadata for the specified photo, it will no longer match the photo referenced in the record’s internal representation of attachment data in the CouchbaseLite database.

    In my testing when I renamed the photo from JavaScript, it was not able to also rename the record’s attachments data, so it effectively removed the photo from display.

    So at the moment, there’s no function to rename a photo from JavaScript.

    Thanks,

    Brendan

    #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.

Viewing 15 results - 481 through 495 (of 3,012 total)