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,191 through 2,205 (of 3,106 total)
  • Author
    Search Results
  • john cesta
    Participant

    I think the way is to use script. But is there a way to pick specific fields
    out of a link to form?

    I don’t think It can be done with tf script.

    #39514
    Brendan
    Keymaster

    Hi Victor,

    I’m sorry but it won’t be possible. I don’t have support for specifying font attributes for text ranges from within a script. And only a Note field can support rich text like that.

    Thanks,

    Brendan

    #39508
    Victor Warner
    Participant

    Would it be possible in a script to use formatting commands such as bold or italic. For example if if there is the following statement:

    result = "and that the annexed paper writing is a complete and exact copy of the " + record.getFieldValue(type_of_document_id) + " of XXXX " + record.getFieldValue(number_of_pages_for_certificate_id) + " that I had caused to be printed on " + record.getFieldValue(date_of_companies_house_inspection_as_text_id);

    and I wished to make the following text

    of XXXX

    bold would this be possible within the script?

    #39478

    In reply to: Inventory and Pricing

    Brendan
    Keymaster

    Hello Eileen,

    1. You would have to do some scripting for this. You would need a script that when the quantity you type in for the selected part for your project changes, Tap Forms would have to know the part you selected and then decrement the quantity on hand value by that quantity entered.

    This is a special case workflow issue that would be common in a dedicated inventory management application, but since Tap Forms is a general purpose database application, you’d have to build that part yourself. But I’ll see if it’s something I can maybe add to the sample Invoices document that I am about to tell you about below.

    2. Instead of using a Link to Form field to keep track of your parts used for a project, it’s better to use a Table field. You can have the Table field linked to your Parts form and choose some fields to copy the values from into the Table field record. In this way, you can have a separate field that you type in the quantity of the part used for that project. This can be used in the calculation to determine the cost. It won’t be pulling in your full quantity on hand value when you do that. This is because when you link forms together with a Link to Form field, you’re actually referencing that exact record from the other form. But with a Table field, it’s copying the values from the linked form and there ends the connection. So you can change the values or add additional fields that don’t even exist in the linked form.

    A good example of this implementation is the Invoices document I have in the Template Exchange forum. But for your convenience, I’m attaching it here.

    There’s 3 forms in the example. Customers, Products, and Orders. Orders would be like your Projects form. Products would be like your Parts form. I don’t know if you have a Customers form, but it links to the Orders form. So for any customer you can see the list of orders. For an order, you can see the list of products.

    Thanks,

    Brendan

    Attachments:
    You must be logged in to view attached files.
    #39470
    Eileen Healy
    Participant

    I make jewelry and I’ve created two forms – so far. One form is for various jewelry parts including
    beads, gemstones, clasps, etc. I’ve viewed this form as inventory. The other is for projects that I’ve either completed or intend to work on and want to make sure I have enough inventory available.

    1. I want to be able to automatically reduce my inventory by the parts used to make the jewelry piece from the projects form; example, I purchased 20 silver beads and need 6 for a bracelet. Amount on Hand field would be 14. I haven’t found a way to create a calculation based on fields from two different forms. Can this be accomplished without scripting? Do I need another form, or other forms, to separate out purchases and its related information versus inventory?

    2. I also want to determine the cost of materials used to make the jewelry piece. I was able to link the parts form to the project form, and I can attach the parts used, but it pulls all my inventory and not the amount of parts used. I have a field set up to calculate the per piece cost on the inventory form.

    I’m hoping this is something I can accomplish in Tap Forms without scripting because I know nothing about scripting. I’ve looked through the forum and templates and haven’t found what I’m looking for. Any feedback is appreciated.

    Eileen

    #39443

    In reply to: Note Field Font Color

    Brendan
    Keymaster

    Hi Obisbis,

    If you switch the Note field to be a Plain Text Note field, then the colour of the font can be set.

    var note_field = form.getFieldNamed("My Note");
    note_field.valueColour = "#C90000";
    
    form.saveAllChanges();

    You can’t adjust individual blocks of text or characters within a Note field using scripts. I haven’t added an API for that.

    #39442
    obisbis
    Participant

    TapForms is not prompting for a password after returning to an open script.

    I have a form with a s script field in it. If I open the script to view/edit it and then switch to another app and back to TapForms then I’m not prompted for a password. However, if the focus is anywhere else in TapForms before switching to another app and back then I get prompted for a password.

    Here is my environment:

    – iPad with latest iPadOS build
    – Enable Touch ID: On
    – Auto-Lock: immediately

    Also, if I just let the screen time out while viewing a script in TapForms, and pressing the home button on the iPad to wake it, I’m not prompted for a password.

    #39438

    In reply to: Counter field?

    Sam Moffatt
    Participant

    You can use a script field to get something like this. Here’s something that gives you a counter within the form. I created a new “Counter” script field and put the value in it:

    function Counter() {
    	//var title = record.getFieldValue('fld-a0c07157d30f400d96b5ff2080574896');
    
    	let counterFieldId = form.getFieldNamed('Counter').getId();
    	let currentValue = Number(record.getFieldValue(counterFieldId));
    	
    	if (currentValue)
    	{
    		console.log(`Using current value: ${currentValue}`);
    		return currentValue;
    	}
    	
    	let maxValue = form.getMaxOfField(counterFieldId);
    	if (maxValue)
    	{
    		let retval = maxValue + 1;
    		console.log(`Using value from search: ${retval}`);
    		return retval;
    	}
    	
    	console.log('Defaulting to a single value.');
    	return 1;
    }
    
    Counter();
    

    You’ll notice a line near the top that is var title = record.getFieldValue but commented out. I did this to make sure that the script triggers on a field. You can double click on a field from your form in the script editor to get a similar effect.

    #39420
    obisbis
    Participant

    I first started using TapForms back in 2009 and continued using it daily and religiously for 3 years straight. I had switched to Android and Windows in 2012 and used them until last month. I used various notes apps on those other platforms but none were really satisfactory. Just a month and a half ago I found my old 3g iPhone in a drawer and thought I might be able to see 3 years worth of notes in the old notes app, I couldn’t even remember the name :-). With a couple of sprays from a compressed air can the phone started charging and long and behold the phone turned on.

    I asked Santa for an iPad this Christmas (2019) so I could see my old notes, and I guess I was a good boy, so I got one, and downloaded the TapForms app and was able to import all my notes from 10 years ago, I was the happiest person on the planet :-). That was the best Christmas ever! So I basically got an iPad to go with TapForms instead of the other way around. That’s how much I love this app. Now I’m thinking of buying an iPhone just so that I could have access to my notes from my iPad. Apple must love you, Brendan! ?.

    Just wanted to say this app is the best organizational app on the planet, even after 10 years it is still the only one I would consider using. I love how customizable it is, scripting, etc., secure with awesome encryption, and how the developer kept on updating it keeping up with the tech industry. And best of all the great support I get directly from the developer. I mean, what more could you ask for!. I will certainly be using TapForms daily and for many years to come.

    Thank you so much for this app! and great work!

    -O

    #39372
    Jose Monteiro
    Participant

    Hi Brendan,

    Thank you for your suggestion.

    Meanwhile I’ve been thinking on how to solve this issue and found one using only TapForms.

    What I did:

    I created one more field on my mac, a Check Mark field to make it simple.
    Then I wrote a small script that would turn on the Check Mark on all records.
    Running this script on the iPhone would turn on the Check Mark field on the 12000 records, and the sync feature would turn on this field on the mac.
    Then with a saved search, searching for the unchecked Check Mark field on the mac I was able to identify the 2 missing records on the iPhone.
    Checkmarking those 2 missing fields on the mac would sync them with the iPhone.
    Then I could delete this checkmark field but I decided to keep it.

    Jose

    Brendan
    Keymaster

    Hi Kurt,

    You can certainly use the barcode scanner to input data into Tap Forms. And with the Scripting engine you could have Tap Forms get data from other places to fill in fields within the record you’re scanning the barcode into. Barcodes can also contain regular text information too, not just some number to use to lookup product information. QR codes are great for storing all kinds of information.

    In the Scripting area there’s an example script that shows how to fetch data from a web service to get movie information given a scanned barcode value.

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

    So with that, you could scan in a barcode into a Barcode field, then Tap Forms will execute the script and fetch movie data from the Internet to populate your record.

    Thanks!

    Brendan

    #39350
    tonyt
    Participant

    Hi Brendan
    I have just updated TF on Mac to latest version. I keep seeing in the release notes that new features have been added each time. Where can I find an up to date list of them I can access, for reference, each time there is a new release and also, where can I find an explanation / instructions as to how to use them? I am just a flat field user with no real database / scripting know how!
    Cheers…

    #39343
    Daniel Leu
    Participant

    With record.addRecordToField() you can link records from a script. The challenge might be to identify matching records.

    On the other hand, you might be able to define the linked forms using the link type ‘join’. This way the linking is automatic. This works well if both forms have a common reference ID.

    Cheers, Daniel

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

    #39333
    Daniel Leu
    Participant

    You should be able to achieve this with a custom layout. First you would need to create a simple script that increments or decrements the counter field. Then in the custom layout, you create a ‘Run Script Button’ and assign your just created script.

    Cheers, Daniel

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

    #39254

    In reply to: Time-Format yyyy-mm-dd

    Sam Moffatt
    Participant

    I think that’s the most elegant way in Javascript. Keeping in mind what you’re working with there is the native Javascript primitives (e.g. toISOString always returns UTC). Most of the recent mentions on the web for Javascript and dealing with date objects will be relevant to Tap Forms as well.

Viewing 15 results - 2,191 through 2,205 (of 3,106 total)