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 - 31 through 45 (of 2,925 total)
  • Author
    Search Results
  • #52816

    In reply to: Listmonk API

    Daniel Leu
    Participant

    Using a form script with the Tap Forms Pro API (https://www.tapforms.com/help-mac/pro/en/topic/javascript-api), you could publish content from TFP to Listmonk.com.

    Cheers, Daniel

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

    #52812
    Victor Warner
    Participant

    I would like help with a Form script concerning a prompt.

    The prompt window displays a date field and then 3 further fields:

    1. Field 1: to the type of service,
    2. Field 2: to choose the number of items, and then
    3. Field 3: how to send it items

    It runs from one form (Notarial Act) and once the fields in the Prompt are populated with data, then the script creates a new record with the data entered in another (Linked to) Form (Disbursements). If all 3 fields are populated, 3 records are created in the Linked to Form.

    The script below does this.

    However, I would like to be able to amend the script so that if Field 3 is set to ‘none’, then only 2 records are created.

    Given the way the prompt script is written/structured, I am not sure how to add this option. Any help would be greatly appreciated.

    `

    var date_id = ‘fld-7b9283660edc4c818320ec930d427747’;
    var type_of_disbursement_id = ‘fld-aad6018d791d477f9c0d323c604712a7’;
    var unit_price_id = ‘fld-5dad44183eb04dc38d6c8565e008be25’;
    var no_id = ‘fld-27cb8e3b36c7472eb4967ccb45b804d9’;

    var output = function printOut(continued) {
    if (continued == true) {

    // take date entered in prompt (put into variable date_of_invoice)
    // and format so it can be written

    var vDate_of_invoice_2 = date_of_invoice.replace(/(\d+)\/(\d+)\/(\d+)/, ‘$2\/$1\/$3’);
    var vDate_of_invoice_3 = new Date(vDate_of_invoice_2);

    // var vDate_of_invoice_formatted = vDate_of_invoice_3.toLocaleDateString(‘en-uk’, {year: ‘numeric’, month: ‘2-digit’, day: ‘2-digit’});
    // var vDate_of_invoice_formatted_ISO = vDate_of_invoice_formatted.replace(/(\d+)\/(\d+)\/(\d+)/, ‘$3-$2-$1′);

    if (service_type==’Standard Service’){

    var Type_of_Disbursement_variable = ‘FCDO – apostille (standard service)’;
    var Type_of_Legalisation_Service_variable = ‘Legalisation agent (standard service)’;

    } else {

    var Type_of_Disbursement_variable = ‘FCDO – apostille (restricted urgent)’;
    var Type_of_Legalisation_Service_variable = ‘Legalisation agent (restricted urgent service)’;

    }

    if (service_type==’Standard Service’){

    var cost_of_apostille = ’40’;

    } else {

    var cost_of_apostille = ‘100’;

    }

    if (service_type==’Standard Service’){

    var legalisation_cost = 18 + (18.00 * number_of_apostilles);

    } else {

    var legalisation_cost = 100;

    }

    let entries = [{
    [date_id]: vDate_of_invoice_3,
    [type_of_disbursement_id]: Type_of_Disbursement_variable,
    [unit_price_id]: cost_of_apostille,
    [no_id]: number_of_apostilles

    },
    {
    [date_id]: vDate_of_invoice_3,
    [type_of_disbursement_id]: Type_of_Legalisation_Service_variable,
    [unit_price_id]: legalisation_cost,
    [no_id]: “1”

    },
    {
    [date_id]: vDate_of_invoice_3,
    [type_of_disbursement_id]: “Courier costs (via legalisation agent)”,
    [unit_price_id]: courier_cost,
    [no_id]: “1”

    }

    ];

    for (let entry of entries) {

    let newRecord = record.addNewRecordToField(‘fld-7e308c2071e248fba8012dee54b53b97’);

    newRecord.setFieldValues(entry);

    }

    document.saveAllChanges();

    } else {
    console.log(“Cancel button pressed.”);
    }
    }

    var date_of_invoice;
    var service_type;
    var service_types = [‘Standard Service’,’Restricted Urgent’];
    var number_of_apostilles;
    var number_of_apostillesx = [‘1′,’2′,’3′,’4′,’5’, ‘7’, ‘8’, ‘9’, ’10’];
    var courier_cost;
    var courier_costx = [’75’,’none’];

    let prompter = Prompter.new();
    prompter.cancelButtonTitle = ‘Cancel’;
    prompter.continueButtonTitle = ‘Go’;
    prompter.addParameter(‘Date of invoice: ‘, ‘date_of_invoice’)
    .addParameter(‘Type of Service: ‘, ‘service_type’, ‘popup’, service_types)
    .addParameter(‘Number of apostilles: ‘, ‘number_of_apostilles’, ‘popup’, number_of_apostillesx)
    .addParameter(‘Cost of the courier: ‘, ‘courier_cost’, ‘popup’, courier_costx)
    .show(‘Add date, number of apostilles, service and whether sent by courier’, output);

    `

    #52810
    Brendan
    Keymaster

    Calculation fields can only get an aggregate value from a Link to Form field.

    If you need to pick out specific records and fields from a related form, you’ll need to use a Script field.

    Calculation and Script fields are essentially read-only.

    #52789

    In reply to: Enabling iOS License

    Alan Hayman
    Participant

    Hi, Brendan,
    That doesn’t do it.
    My iPhone is an 8 Plus (I know, it’s obsolete) running iOS 16.7.10, and my iPad is an M1 iPad Pro 13″ running iPad OS 17.6.1.
    In both cases, when I tap the blue “Subscription Options” button from the 10-record limited screen, and then tap “Restore Purchase”, it hesitates for a moment, and then goes back to the 10-record limited screen with the “Subscription Options” button.
    In both cases, I have WiFi turned on, and I have Tap Forms Pro open and running on my Mac.
    Suggestions?
    Thanks.

    #52750
    Glen Forister
    Participant

    That is what I was looking for. I thought I had that answer in my Form of questions in TF, but couldn’t find it. So I went to copy the question and answer to enter it into my Questions form.

    WHAT? I can’t copy any text from this web site anymore. How are we going to copy those Scripts to use in our forms???

    #52737
    Mark Moran
    Participant

    I’m in the process of refining a document. I’ve added a couple of field scripts to several of the forms. The forms alrady have several hundred records. How do I get the form to run the script on all the existing records besides going through each one and clicking the recalculate formulas circled arrow?

    #52713
    karen james
    Participant

    Thanks Brendan. I’ve subscribed to TF Pro on my iPad, I’m just trying to decide which, if any, of the DB’s I haven’t migrated from TF5 are worth it. If TF5 were going to be operable, it’d be a non-issue. So, I’ll take some time with them and see what I want to put my effort into. As for my iMac, I’m just not ready to commit to the subscription only because I’m not sure I need those extra features.

    Daniel, thank you as well. I have 2 iMacs. One is brand spanking new(a lovely gift from my hubs and kids for Mother’s Day) and a 2017 iMac. I could continue to run TF5 on that one. So here’s a question. Will TF5 continue to work on newer iPads once Rosetta 2 is discontinued? I tend to do the majority of my work from my iPad, but it is nice to be able to work from my iMac too.

    #52703
    Alan Hayman
    Participant

    Hi, Brendan,
    Version 1.07 does not fix this problem.
    I paid the subscription fee when Tap Forms Pro was first released, and I look forward to becoming a steady user, but until this bug is fixed, I will continue to use Tap Forms 5, which works correctly.

    #52694

    In reply to: Apple shortcut support

    Daniel Leu
    Participant

    With Run Script in Tap Forms Pro you can implement all these and have them behave exactly as you’d like.

    Cheers, Daniel

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

    #52677
    Steve-Kai Vyska
    Participant

    Hello everyone,

    i do not understand, what I’m doing wrong.

    I just want a simple Promt, that asks for one Value when you hit the bottom.

    my script looks like this:
    var varKurzbeschreibung;
    var varStrasse;
    
    var callbackFunction = function() {
    	console.log(varKurzbeschreibung);
    	console.log(varStrasse);
    };
    
    let prompter = Prompter.new();
    prompter.cancelButtonTitle = 'No Thanks';
    prompter.continueButtonTitle = 'Go For It!';
    prompter.addParameter('Kurzbeschreibung', 'varKurzbschreibung','text')
    .show('Neues Haus eingeben', callbackFunction);

    When I Start the script, I get the box withe the labels but I can not enter anything. The box for entering is missing,

    When I add

    .addParameter('Strasse', 'varStrasse', 'popup')
    the box is shown, but also a pickup Box, what I do not want,

    What am I doing wrong?

    Thanks
    Steve

    #52675
    Brendan
    Keymaster

    I just fixed the favourite scripts bug.

    #52674
    Brendan
    Keymaster

    Ah right. Sorry about that. I didn’t realize you weren’t referring to the Mac version.

    Ya, I haven’t built the script sorting function into the iOS version. Certainly something I should add.

    I’ll look into the favourites issue.

    #52673
    Fernando Duran
    Participant

    Hello Brendan, thank you for your quick response. I forgot to say that I use the iPhone, I don’t have a Mac. I have already tried to press and drag the scripts without success. And on the iPhone I have not been able to modify the font of the List mode, as I can do in Tap Forms 5.

    By the way, I’ve seen something else. I can’t run the scripts from the Favourites section, only from the Run a script section.

    #52672
    Brendan
    Keymaster

    Hi Fernando,

    You can just drag and drop your scripts to put them into the order that you want them to be in.

    I don’t have a function for changing the font in Tap Forms for Mac for the single column list view.

    Thanks,

    Brendan

    #52671
    Robin McClish
    Participant

    Thank you so much, Daniel! I’ll try that. Btw, I went looking but couldn’t find where to search for the answer. Can you tell me if there is a document that covers script differences between TF and TFP? Mmaybe I just missed it.
    Thanks again,
    Robin

Viewing 15 results - 31 through 45 (of 2,925 total)