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 - 2,551 through 2,565 (of 2,950 total)
  • Author
    Search Results
  • #34034
    joe omalley
    Participant

    Brendan…Thanks for the free invoice form! Question…Is it currently within the realm of Tap Forms to be able to automatically populate the description and the price of a product or service in a subform (table) when entering in the Item # column via dropdown from another form. Just wondering. This would be golden!

    #34027
    Paul
    Participant

    My apologies if the info I seek is already posted here, I have searched, but cannot find reference to what I’m looking for. I am very new to TapForms, sorry for the Noob inquiry.

    I work for a Utility company and we have a project coming up where we will need to do site surveys of over 130 sites throughout the region.

    Data that we need to capture for each site (utilizing TapForms) revolves around the door lock hardware. We will need to collect about 20 pieces of data per door such as: Lock hardware, condition, handing, material, etc. We will also want to have room for at least 3 photos per door and also room for comments. The sites range in size from 2 doors to 30 doors. The data (and photos) will then get imported into a database for future reference. It seems that the linking function will fit the bill, I’m just not familiar enough with its use to make it work properly.

    Is there a way that I can start a record called site, then add doors underneath that record? OR would it be best to have each door as a unique record? I’m trying to get around entering site name, address etc. multiple times per door for larger sites and streamline this process as much as possible.

    I hope this description makes sense. Thanks for your help, much appreciated.

    Paul

    #33928
    Kirk Williams
    Participant

    Thanks Brendan! Sorry, I’m very new to TF and am likely over-complicating this description. To hopefully clarify, what’s not updating is the picklist on the child form when additions are made to its linked parent form. So the parent has records “A”, “B” & “C” – all of which are available in the child’s linked picklist. When entering a record in the child form, I realize I need a “D” parent, so I go to the parent form (either using a new window or by switching to it) and add it. When I return to the child, “D” does not appear unless the entire TF file is closed & re-opened.

    #33883
    Brendan
    Keymaster

    Hi John,

    Tap Forms is doing the TOTAL() because you have a Link to Form field there and it doesn’t know which record to use, so the only choice is an aggregate calculation for the field from all the linked records.

    You’ll have to add your Calculation field to the Filament form instead. Make sure you have the “Show Inverse Relationship” option enabled. Now, if the relationship between your forms is a one-to-many then on your Filament form you can access directly the parent field’s Filament Used (mm) field to do your calculation. But if it’s a many-to-many or a Join Link Type, then that won’t work.

    With a Form Script or a Script Field you could write some JavaScript to pick out an individual record from the Cost per mm Link to Form field and then use that value in your calculation.

    Thanks,

    Brendan

    #33878
    Brendan
    Keymaster

    Hi Stephen,

    Excellent! I’m glad that has helped a bit.

    Tap Forms will write a bunch of the Script code for you by using the Snippets provided and just by double-clicking on the fields in the Fields list on the Script Editor. So you can do some basic stuff quite easily there.

    I know, easier said than done :) Hopefully it won’t be too difficult for you to learn a bit of JavaScript.

    Thanks,

    Brendan

    #33876
    Stephen Froggatt
    Participant

    Thank you, Brendan, very much indeed.
    Your reply is crystal clear and helps me understand better how the Linked Forms work.
    I have moved some of the fields around a bit on my forms so that they are now referenced in the correct direction. Everything now works as intended!
    You have also inspired me to learn some JavaScript programming in order to make use of “calculation fields on steroids!”
    Many thanks again for your full, prompt and helpful response.
    Every blessing,
    Stephen

    #33870
    Brendan
    Keymaster

    You can get what you want from the other direction, but not from the parent form. That is, on your Baby form you could add a Calculation field that references the Date Visited field from your Visit form.

    If you think about it, you have multiple visits, each with its own Date of Birth and Baptism Date. So which one do you want?

    The Calculation field is not able to reference an individual Link to Form field’s record.

    The Script field can though. To do that you would have to fetch the Link to Form field’s records, then pick out the first record and then do your calculation.

    #33859
    Richard Hassell
    Participant

    I need to make a field called full name that incorporates a first name field and last name field with a space between the names.. I use the script as below however as soon as I put a space between the ‘ and ‘ the program freezes and I have to force quit.

    function Full_Name() {
    var first_name = record.getFieldValue(‘fld-ee04b40fb2b64df5b26e7bf330e46657’);
    var last_name = record.getFieldValue(‘fld-f6c97003b1124b9ba8bd677d2142213f’);
    return first_name+”+last_name;
    }
    Full_Name();

    any advise?

    I am running : Version 5.3.5 (Build 943)
    on OSX 10.14.3 with latest updates as of today.

    Thanks Guys!

    #33852

    In reply to: label fix field length

    Brendan
    Keymaster

    Hi David,

    There are a couple of ways you can deal with variable width values for mailing labels.

    One option is to add a single static text object to your custom layout for your label and put the field names into it surrounded by square brackets.

    For example:

    [First Name] [Last Name]
    [Street Address]
    [City], [Province]  [Postal Code]
    [Country]

    When setting up your label this way, the width of each value doesn’t matter as it will accommodate the space required for the variable width values.

    You do have to make the box wide enough to accommodate the largest width label though.

    The other way to do it is to create a Calculation or Script field which concatenates the field values and then just place that one field on your label.

    See the Text Concatenation sub-topic in the Calculations topic in the online user manual:

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

    Thanks!

    Brendan

    #33847
    Kirk Williams
    Participant

    Thanks Brendan! I am currently using the shortcuts; with moving data into this particular form from other sources I’m using copy/paste a lot and thought it would just be a bit more ergonomic to have a quick-click shortcut to navigate records. I did add a script button to add a new record – that works well.

    Obviously no major big deal. I was just wondering if there was an easy way to script the prev/next functions for this particular case.

    Thanks as always!

    K

    #33844
    joe omalley
    Participant

    Hi B. Any chance of getting a video tutorial on how how to use a scripts. I’m a visual learning person. I’ll hang up and listen for your answer. Thanks

    #33832
    Kirk Williams
    Participant

    Greetings again,

    Is there a simple way to add navigational controls on a custom layout? I’d like to add some basic buttons to navigate to First, Previous, Next, Last & Create new records.

    I’ve tried adding a script for a keyboard shortcut, but TF will not allow me to use key combos that are already assigned. And as a disclaimer – yes, I know there is navigation in the app itself, but the prev/next buttons are relatively small and reside WAY too close to my auto-hide app bar when in full-screen… when adding records in bulk it becomes quite a nuisance.

    Thanks in advance!

    Brendan
    Keymaster

    Hi Victor,

    I’m sorry but I don’t have a feature like that at the moment. Although Tap Forms Mac can send an email either via the Print function when using Mail PDF to email, it won’t use an email address from the record to address the email in that situation. Or you can use the Email Selected Addresses feature to compose an empty email to the people with the selected email addresses in your records.

    I haven’t done a lot of work on the AppleScript support apart from executing Form Scripts from AppleScript.

    Thanks,

    Brendan

    #33796
    Kirk Williams
    Participant

    Thanks again for your help Brendan! I was able to make this work, although I likely did it in the most bone-headed manner possible (I hope to clean it up as I learn more about scripting).

    Just in case the reference may be useful to others, here’s the “solution” that produced the desired output:

    Each record in my form has four photo fields (“Photo1” – “Photo4”). How many of those fields are used varies by record, but every item must have at least one, and the photo fields are entered sequentially (meaning that, in theory, “Photo1” will never be blank).

    I also use an “Image Prefix” text field in which the URL is entered. This value only changes monthly, so I update the default value for new records at the beginning of each new month.

    With that in mind, I only altered the code you provided by updating the field ID’s and references and changing the URL reference from the static text to my “Image Prefix” field ID.

    function Photo_Links() {
    
    	var photo1_id = 'fld-b83135f083fe44b98835538c57a94834';
    	var photos = record.getFieldValue(photo1_id);
    	var links = "";
    	var image_prefix_id = 'fld-dea58cfd801f4e75882f397fc37a5df2';
    	var image_prefix = record.getFieldValue('fld-dea58cfd801f4e75882f397fc37a5df2');
    	
    	for (var index = 0, count = photos.length; index < count; index++){
    		var photo_data = photos[index];
    		var filename = photo_data['filename'];
    		links = links + image_prefix + filename;
    
                    // append a comma at the end of the link only if this is not the last link
    		if (index < photos.length - 1) {
    			links = links + ",";
    		}	
    	}
    	return links;
    
    }
    
    Photo_Links();

    The code above is used to populate a field titled “Photo1 Name”. I then replicated the same code to create fields referencing the remaining three photo fields (“Photo2 Name”, “Photo3 Name, “Photo4 Name”). For photos 3-4, I changed line 5 to insert a comma followed by a space instead of the original null value:

    function Photo_Links() {
    
    	var photo2_id = 'fld-e0aac08a96714b6390443627e49e73c1';
    	var photos = record.getFieldValue(photo2_id);
    	var links = ", ";
    	var image_prefix_id = 'fld-dea58cfd801f4e75882f397fc37a5df2';
    	var image_prefix = record.getFieldValue('fld-dea58cfd801f4e75882f397fc37a5df2');
    	
    	for (var index = 0, count = photos.length; index < count; index++){
    		var photo_data = photos[index];
    		var filename = photo_data['filename'];
    		links = links + image_prefix + filename;
    
                    // append a comma at the end of the link only if this is not the last link
    		if (index < photos.length - 1) {
    			links = links + ",";
    		}	
    	}
    	return links;
    
    }
    
    Photo_Links();

    With all four photo fields now populating exactly what I need, I just added a calculated field that returns the values of all “PhotoX Name” fields sequentially. Since the photo name fields return null values when there is no image, I’ve got a comma-separated list of each item’s photos that plays nicely with the Woocommerce import (essentially, I’m just prepending the comma rather than appending it based on logical conditions).

    I’m sure experienced scripters will cringe reading this lol… I’m always up for learning, so I’ll happily entertain any suggestions on how to clean this up.

    THANKS SO MUCH again for your help!!!

    K

    Victor Warner
    Participant

    Is is possible to send an email from/with Tap Forms using the contents of some fields of one record to populate the email. For example, an email field to be set as the recipient, another as the subject of the email, etc.?

    I hardly know AppleScript but I can see that it provides a way of automation the generating an email. But I cannot see in the AppleScript library for Tap Forms to way to address individual fields. But that could be because of my ignorance.

Viewing 15 results - 2,551 through 2,565 (of 2,950 total)