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 - 406 through 420 (of 2,950 total)
  • Author
    Search Results
  • #50263
    Glen Forister
    Participant

    That is why I would prefer to use the script solution.  Unfortunately, what Daniel supplied:

    But, it adds the first two records then subtracts any following numbers which isn’t helpful.

    I’ve looked at the script, but don’t understand how it jumps out of the loop and starts subtracting instead of adding to the total.

    Can you please give me a script that works?

    #50246
    Glen Forister
    Participant

    I tried to use the script from my rain totals script to do a similar job, but I’m missing something to be abel to add up the record totals, to an accumulation of the record totals.

    Hope this is a simple fix.  See attached archive file with dummy data – just getting started.

    Attachments:
    You must be logged in to view attached files.
    #50227

    In reply to: Export to .md or .txt

    Brendan
    Keymaster

    Do you mean from a Script? You posted in the Script Talk forum, so I’m not sure if you’re asking a general question or a script specific question.

    You can use the Export Records function to generate a CSV file of your records.

    #50217
    Brendan
    Keymaster

    Hi John,

    There’s no function to trigger a script by double-clicking on a field.

    However, you can have Tap Forms add 1 to another field if the Number field is manually changed by using a script.

    When you call the record.getFieldValue(field_id) function, the field that corresponds to field_id will be monitored for changes. When the value changes in that field, the script will be executed and you can have it increment the value in another field, or return the value right from the script field which could be the monitored field’s last value plus one.

    Thanks,

    Brendan

     

    #50215
    John Juhl
    Participant

    Hi guys,

    I would like to make a script that will add 1 (one) to an existing sum in a number field.

    so that by double-clicking the field, it goes from, for instance, 110 to 111

    But how can I do this?

    kr.

    John

    #50214
    Kathy DeVault
    Participant

    Thank you for the quick reply, that’s perfect! I was hoping there was an easier way than writing script.

    I appreciate the help!
    Kathy
    #50213
    Brendan
    Keymaster

    Hi Kathy,

    One possibility for you instead of having all the fields from the link to form appearing there, click the little tool button that looks kind of like an X at the top-right of the table view. From there you can select and de-select the fields you want to see. Plus you can also drag the fields up and down and that will change the order they display on the horizontal table view for the Link to Form field.

    Give that a try and see how it works for you.

    If you need something other than that, you’ll need to write a script that pulls out the data from the child form to display it on the parent form.

    Thanks,

    Brendan

    #50208
    Brendan
    Keymaster

    You could write a Script you could run that takes the shopping list values and adds them to the Reminders.

    function Add_And_Update_Reminder() {
    // Create new Date instance
    var due_date = new Date();
    
    // Add a day
    due_date.setDate(due_date.getDate() + 1);
    var event_info = {"list_name" : "Work",
    "title" : "Test Event",
    "priority" : 1,
    "notes" : "test note",
    "repeat_option" : 2};
    
    var identifier = Utils.addToReminders(event_info, due_date);
    console.log(identifier);
    event_info["title"] = "Hello Reminder 2";
    Utils.updateReminder(identifier, event_info, due_date);
    }
    
    Add_And_Update_Reminder();
    • This reply was modified 1 year, 11 months ago by Brendan.
    #50205
    Brendan
    Keymaster

    Hi,

    If you setup your Recipes form with a relationship to an Ingredients form, then you could select some recipes to print to make a PDF file that you could browse while you’re shopping. Not exactly an interactive experience though like you might get from a dedicated shopping / recipes app. But it would be possible.

    Another way might be to write a Form script that lets you select specific recipes and then inserts the ingredients for those recipes into another form that contains your shopping list items. This would be an involved script to write though.

     

    #50176
    Fernando DS
    Participant

    At last this is the script that works:

    function modifyFieldsBasedOnCondition() {
    var fieldId1 = ‘fld-28b97ce8ab4f4f57a83aefa7e91f17fe’;
    var fieldId2 = ‘fld-c2fd26ae62c1445692b3a0abc1e89158’;

    for (var record of form.getRecords()) {
    var valueField1 = record.getFieldValue(fieldId1);
    var valueField2 = record.getFieldValue(fieldId2);

    if (valueField1 === 4 && (valueField2 === null || valueField2 === “”)) {
    record.setFieldValue(fieldId2, “Buen disco.”);
    console.log(“Campo fieldid2 actualizado en el registro con campo fieldid1 igual a 4 y fieldid2 vacío.”);
    }
    }

    form.saveAllChanges();
    }

    modifyFieldsBasedOnCondition();

     

    Thank you Brendan and Daniel for your valuable help.

    Bye.

     

    #50153
    Fernando DS
    Participant

    Hi Brendan, thank you for your answer. The script is steel not working.

    Attachments:
    You must be logged in to view attached files.
    #50150
    Fernando DS
    Participant

    Hi. I want to do an script for autocomplete a note field called “Comentario” with “Buen disco.”, when the valoration field “Valoración” has four stars and, at once, the field “Comentario” is empty. I have not errors in the console, but the script does not work. Any help will be welcome. Thank you.

     

    Attachments:
    You must be logged in to view attached files.
    #50143
    Glen Forister
    Participant

    I just did:
    Copy New Form to another experimenting Form.
    Then imported the data file into it and ended up with just 3 records which were only the added record and the 2 changed records.

    Where are all the other records.  And, the calculations (not JavaScript) don’t work, but the names of the fields in the calculations are right.  Do they have to be redefined?

    This is ridiculously problematic.  I never had any trouble like this in HanDBase when wanting to do this.

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

Viewing 15 results - 406 through 420 (of 2,950 total)