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 - 781 through 795 (of 2,989 total)
  • Author
    Search Results
  • #48089
    Brendan
    Keymaster

    Sure. Have a look at the Scripting instructions in the online user manual:

    https://www.tapforms.com/help-mac/5.3/en/topic/scripts

    Look for the topic on that page called Fetch Movie Data From Web Service

    That script will monitor the changes made to a barcode field. If that field changes, Tap Forms will make a web service call to fetch a JSON object related to the movie for the barcode entered. Then it will populate the fields in that record from the data fetched from the web service.

    #48088
    Prashant M
    Participant

    This is awesome ! Thanks. I know how to create my webhooks , can I get an example of something like this from scripting perspective?

    #48063
    Brendan
    Keymaster

    Records are saved after every value is changed. You could setup a Script Field which monitors the values of a specific field (or fields) and then execute some web service call whenever the value in that field (or fields) changes.

    #48043

    In reply to: Overdue Date

    Daniel Leu
    Participant

    I’m using a script field that calculates if something is due. Then I can search on this field.

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

    Cheers, Daniel

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

    #48038
    Jake Gregory
    Participant

    Hi Everyone,

    First time posting here – very new user of Tap Forms.

    I’ve got a price list going on the Mac version, I would like to know if there’s a way I can run a script to increase the number in a number field by a percentage.

    I don’t even seem to be able to get of the ground so if someone could show a code example I would really appreciate it.

    Thanks

    #48034
    Chris Ju
    Participant

    Hi,

    i’m using the following java script code to replace characters:

    
    var chars = {'ß':'ss','&':'und','.':'','ö':'oe','ä':'ae','ü':'ue','é':'e','è':'e','Ö':'Oe','Ä':'Ae','Ü':'Ue','É':'E','È':'E'};
    var nachname = (record.getFieldValue('fld-eef248f9679f47eb98598b22133da6ea').toString().replace(/[ß&.öÖäÄüÜéÉèÈ]/g, m => chars[m])).toString().replace(/\s/g, '%20');
    

    Nothing is replaced with this code.

    Adding for example UTF-16 code for character ‘ü’ -> ‘\\u00fc’ to the second variable string:

    
    var chars = {'ß':'ss','&':'und','.':'','ö':'oe','ä':'ae','ü':'ue','é':'e','è':'e','Ö':'Oe','Ä':'Ae','Ü':'Ue','É':'E','È':'E'};
    var nachname = (record.getFieldValue('fld-eef248f9679f47eb98598b22133da6ea').toString().replace(/[ß&.öÖäÄüÜéÉèÈ\\u00fc]/g, m => chars[m])).toString().replace(/\s/g, '%20');
    

    leads for for example with the text “Stümper” to

    ‘Stundefinedmper’

    Even if i add the UTF-16 code to the first variable, results to the same undefined issue.

    Does anyone have an short idea to solve that?

    Thanks
    Chris

    dan carter
    Participant

    Here are the 2 involved forms. Clients and Leg Curl. A client will eventually have many Leg Curl records with varying Target amounts. I would like getMax… and getMin… functions to display least and most Target amount, as well as, percent Change. The Duplicate Exercise script is where I attempt, unsuccessfully, to do this.

    This DB is being developed on and for an iPad.

    Thank you for having a look, Dan

    • This reply was modified 3 years, 3 months ago by dan carter.
    Attachments:
    You must be logged in to view attached files.
    dan carter
    Participant

    Thank you for the idea Daniel. This application will be used only on an iPad. Unfortunately when I use field scripts they prevent my form scripts from working.

    My console.log returns “0” for min and max target.

    I will upload my form template as per Brandon. I’m sure I’m missing something simple.

    Brendan
    Keymaster

    Hi Dan,

    If you export your form template (.tff) and post it here, we can look at it and see what’s going wrong with your script.

    Thanks,

    Brendan

    Daniel Leu
    Participant

    Hmmm… I expected to see a Field Script like this:

    var target_id = ‘fld-d984603583864e5fb5af42de33ff177d’;
    var last_first_id = ‘fld-b052524e3f814d909bdc1256d5153f51’;
    record.getMinOfLinkedFieldForField(target_id, last_first_id);

    But for your Form Script, I would check if the values you get are correct:

    console.log("min target: " + min_target);
    console.log("max target: " + max_target);

    I don’t see why you create duplicate a record and then don’t use it.

    Cheers, Daniel

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

    dan carter
    Participant

    Many thanks for looking Daniel. You’ll also see some comment out lines I’ve tried.

    var date_id = ‘fld-b5cc9a209ab94005862f111287a1c6e8’;
    var target_id = ‘fld-d984603583864e5fb5af42de33ff177d’;
    var change_id = ‘fld-3f28cc416bf34e9fbe70122e65fb8d22’;
    var last_first_id = ‘fld-b052524e3f814d909bdc1256d5153f51’;
    //var client_id = ‘fld-cb862ea49ea64d7c8f8fbdbf6cabd80c’;
    var min_target = record.getMinOfLinkedFieldForField(target_id, last_first_id);
    var max_target = record.getMaxOfLinkedFieldForField(target_id, last_first_id);
    //var max_lc_total = record.getMaxOfLinkedFieldForField(target_lc_id, client_id);
    var copyOfRecord = record.duplicate();
    record.setFieldValue(date_id, new Date());
    record.setFieldValue(change_id, (max_target / min_target)-1);
    document.saveAllChanges();

    Utils.alertWithMessage(‘Script Run Complete!’, ‘Cool!!!!!’);

    Daniel Leu
    Participant

    Do you mind to share your script?

    Cheers, Daniel

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

    dan carter
    Participant

    Hello,

    I have a parent form called Clients and child form with a number field called Target. I’d like to use record.getMaxOfLinkedFieldForField(linkedFieldID, fieldID); to find the max of Target for each particular client.

    I’ve tried using different field ids in the linkedFieldID and fieldID positions and the the script will run without errors but no output is produced.

    Are others having success with this?

    Kind Regards, Dan

    #47985
    dan carter
    Participant

    I found the issue. Several field scripts were the cause. I can move them to the record duplicating script.

    #47984
    dan carter
    Participant

    Hello All,

    I have TapForms iPad form connected to a client form via a “linked to form field”. When I run a simple script to duplicate the current record, the duplicate doesn’t show up until I return to list view.

    The script:

    var copyOfRecord = record.duplicate();
    document.saveAllChanges();

    This works as hoped in a “Table Field” record, but not otherwise.

    I’m surely missing something.

    Kind Regards, Dan

Viewing 15 results - 781 through 795 (of 2,989 total)