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 - 1,771 through 1,785 (of 2,952 total)
  • Author
    Search Results
  • #41383
    Sam Moffatt
    Participant

    It sounds like you’ve got two forms already and you want the same table on the two different forms. I’d suggest adding a third form that has the same structure as your table field and then use a “Link to Form” with the “JOIN” type. JOIN uses a field value that is common between the two forms to automatically build the links. In your case I think a customer ID would be a reasonable link value because you can put that on all three forms and link it together.

    The Link to Form behaves similar to the table so you should be able to get the same effect in both places relying upon the same data.

    Now I have a feeling that you might need this in thee future but a trick you can do with JOIN fields is to use a calculation field to JOIN on. You can use a calculation field to combine the values of two different fields together (via CONCAT) and use that value. In your example I can imagine a customer at some point stopping a service at which point they shouldn’t get invoiced for it in the future but you might want to include it in their printed invoice. You could add a checkbox or other flag that you check and use as a part of the composite key. The downside of this approach is that older invoices if reprinted will look different, so let’s think about that.

    A JOIN field is great because it automatically updates values for you. A JOIN field is unfortunate because it automatically updates values for you. Thinking about “what services does the customer currently have active”, what you could do is when you generate an invoice you use a script to manipulation a normal “Link to Form” M:M field instead of a JOIN field. You would need to write a script to handle creating a link from the third form we created above to do it.

    Give the JOIN field a try and see how it works out for you, if you feel we need to go down a little deeper on the scripted approach then I can give you a hand with that too.

    #41381
    David Oxtoby
    Participant

    I did a search, but couldn’t find anything that offered a solution….

    So, i have a table on one form that is a break down of the services a customer is receiving, (item, price, etc), and then on my invoice form which is a summary, i want to also show the same breakdown table, but without adding all the items in again from scratch. So…. is there a way when linking two forms, to show the table field from one on the other, it looks like there isn’t, therefore is a work-around….

    have a script in the from that holds the table, to somehow extract the table content into a hidden text field that somehow formats the text, and then on the linked form just show that formated text field instead of a table?

    or am i missing something really basic here…… many thanks

    #41377

    In reply to: Reminder Calendar

    T.L. Ford
    Participant

    That is an incredible amount of calculations you’ve managed there. I’m still trying to figure out how you made it all work. Reminds me of some spreadsheets I’ve created.

    I’m attaching an equivalent form done with scripts merely for comparison. It’s a different solution, not necessarily a better solution.

    Attachments:
    You must be logged in to view attached files.
    #41367
    Daniel Leu
    Participant

    Tap Forms needs a javascript call to refresh the form display (similar to the View | Refresh Records List menu item).

    +1

    I’ve been asking for such a feature for a long time… Nice to see someone else wanting it as well :)

    Cheers, Daniel

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

    #41361
    T.L. Ford
    Participant

    Tap Forms needs a javascript call to refresh the form display (similar to the View | Refresh Records List menu item). This would also solve a script on a many-side not correctly refreshing the view on the one-side.

    Tried several ways (attached), but none are an acceptable solution.

    Attachments:
    You must be logged in to view attached files.
    #41359
    T.L. Ford
    Participant

    Not too sure what happened to my reply, so I’ll repost. I just got Tap Forms and am playing around with it and this request, although long deprecated, was an interesting challenge. Here’s my solution.

    http://cattail.nu/tap_forms/Apothecary.tapforms.zip (2mb – it’s an archive with demo data and help table).

    The data schema is attached here and shows the one-to-many relationships in use.

    The calculation update is in one monolithic script and I’m now playing with record-level script fields.

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

    In reply to: Script for Printing

    Brendan
    Keymaster

    Hi Roy,

    Maybe you don’t need a script to do this. Have you tried just printing out the Default Layout and see what kind of output you get?

    However, you can create a new field and select Script as the Field Type. Then select your Song Title field from the list of fields on the Script Editor. Then double-click on the Child Records Loop Snippet and Tap Forms will write the code for you to loop through all of the Songs for the selected record. Then all you need to do is concatenate them together into a single string and return that.

    Something like:

    function SongTitles() {
    
    	var songs_id = 'fld-1ad42e9404674124aa6871c367249f1d';
    	var song_title_id = 'fld-177726d9d3b44645941e6d6488bcfbd1';
    	var songs = record.getFieldValue(songs_id);
    	var song_titles = [];
    	
    	for (var index = 0, count = songs.length; index < count; index++){
         	var song_title = songs[index].getFieldValue(song_title_id);
    		if (song_title) {
    			song_titles.push(song_title);
    		}
    	}
    	return song_titles.join("\n");
    }
    
    SongTitles();
    #41352

    In reply to: A Few Questions

    Brendan
    Keymaster

    Actually you can now…

    tapformz://form/view/db-xxx/frm-xxx

    and you can execute scripts:

    tapformz://script/db-xxx/frx-xxx/scriptName

    #41336

    In reply to: A Few Questions

    Christin White
    Participant

    3. That’s a really good point, I guess what I’m really looking for throughout most of these questions/requests are ways of streamlining UI/data manually and contextually to fit the use and provide more flexibility. The nice thing is that Tap Forms seems to do almost everything I want it to functionally, the underlying data isn’t limited so I can adopt it now and hope for some more presentation control in future versions.

    5. I was looking over the APIs after I posted that yesterday and it looks like it’s quite powerful, JS isn’t my favorite language in the world but getting better at it has long been on my todo list since JXA is used in a lot of my Mac automation tools and things like Scriptable and JSBox are so powerful on iOS if you want to go beyond just Shortcuts for automation (I like Python even less ?).

    Ah, I went back and looked at the edit form and couldn’t figure out how I was deleting instead of saving, spam filtering makes sense, thanks for clarifying that.

    #41335
    Victor Warner
    Participant

    I would like to combine a Notes field with other in a script, but if the Notes field is empty I wish to display just the other fields.

    I have created a test database with a test script as follows:

    var notes_id = 'fld-9d8543d9d39f409194349c1a855d7728';
    var notes = record.getFieldValue('fld-9d8543d9d39f409194349c1a855d7728');
    
    var new_work_address_id = 'fld-943ab25fd0de42e7b8d1e5487c6a358b';
    var new_work_address = record.getFieldValue('fld-943ab25fd0de42e7b8d1e5487c6a358b');
    
    if (notes == "") {
    
    result = new_work_address
    
    } else {
    
    result = new_work_address + "\n\n" + notes;
    
    }
    
    result

    But if the Notes field is empty the result is the content of new_work_address plus plus the word ‘undefined’

    Is there a way to test for whether a Notes field is empty?

    #41334

    In reply to: A Few Questions

    Sam Moffatt
    Participant

    2. I’ve thought for a while that a custom layout using the default layout view but with the ability to re-order fields and hide ones that aren’t important would be an interesting addition and could provide a form of custom layout support on the mobile platforms as well. I used section headings to collapse down records and keep them clean during editing though that isn’t a good fit for your use case.

    3. The problem is that those fields are still editable in the sense that they can create an entry on the other side of the link. I can see your use case though and I think an implementation path forward could be per record overrides for field settings which could hide the field just for that record via a script interaction (though that isn’t a feature that exists today).

    5. TF uses Apple’s JavaScriptCore for the scripting so almost anything you can do in JavaScript you can do in Tap Forms. Check out the JavaScript API for details about Tap Forms specific functionality but you can manipulate almost any data item in the application via the scripting interface.

    As an aside, editing the post generally gets caught by the antispam as that is a technique to change a post after it’s been visible to hide links in it. I’ve been caught a few times by it myself.

    #41331
    Sam Moffatt
    Participant

    That’s a limitation of that particular model because you can only link to a form record not an entry inside a table field. It looks like what you’re after is more the article than the magazine so if we pivot a little to make the ‘Articles’ their own form then you can skip the script and just use a Link to Field with JOIN and I think it’ll give you the read out you’re looking for.

    Here is a new TFArc with a new Articles form setup as a Link to Form JOIN to the Keywords form and also setup with a Link to Form 1:M from Magazine to map that back. Inside of Articles I added two calculation fields to map down fields from the Magazine form into the Articles one which can be seen in the list view in Keywords. The existing fields are still there but with some renames.

    Attachments:
    You must be logged in to view attached files.
    #41329
    Brendan
    Keymaster

    Hi Rocky,

    That’s interesting. I would have thought that if the record didn’t quality for the search results after the script is run, that’s why it would disappear. But you said that the script does not touch a field that’s in the list of search rules.

    Would you be able to email me your form template so I can test it out here?

    Thanks,

    Brendan

    #41326
    Rocky Machado
    Participant

    Hi Brenden – Not sure if this is by design, but thought I would ask. I currently have a Trade Journal form layout that has a button which executes a script. I noticed that when I’m in a search filter and execute the script via the button click. I noticed the transaction disappears from my search filter list and I have to hit the refresh (recalc the search filter) button in order for my transaction to show up on my list again. The filter criteria for my search is based on a date/time field (looking at today transactions). The fields that I’m populating has nothing to do with the search filter so I am not quite sure why the transaction would disappear (unless it event driven). Is this the expected behavior? So to make this work, I have to click the button and then hit the recalc button for the record to reappear. I’m wording if I am doing something wrong. When I execute the script I do a form.saveallchange() for my changes to take effect.

    thanks,
    rocky

    #41316

    In reply to: A Few Questions

    Christin White
    Participant

    Huh, okay, every time I try to edit my post it deletes it instead, sorry for the multiple pings, hopefully I’ve figured out the way to get the markdown to not collapse spaces and dashes, if not apologies for not being as clear as I’d like.

    Thanks Sam and Brendan!

    1. Brendan’s suggestion worked for me, If I have trouble in the future I may look at those other sync services.

    2. Hmm, that does make sense in this context and having a single form for media that can match some pre-selected types is a more elegant way to approach this, it just means each record will have a lot of superfluous fields specific to other types of media.

    I hadn’t played with custom layouts yet, having done so now I feel like it’s a bit clunky and page/print-centric for me, I definitely prefer the more responsive UI design of the default layout, it’s a pity that it can’t be duplicated but some fields simply hidden or even just section headings collapsed for each layout.

    3. That’s certainly a good idea but this was just an example, combining media types or people and companies into combined forms aren’t always going to work for every example, it would be nice if records could be toggled to simple hide unused inversely linked fields.

    4. Along the same lines it would be sweet if *Many to Many* relationships with only a single link could collapse to a non-table view or a *Many to One* option existed.

    5. I did a poor job articulating this but it looks like you got the idea. Basically, I want a tagging system tags can be nested and parent tabs inherent the items of their child tags like Bear does. So basically you get something like this:

    Parent Tag 1 (Record 1, Record 2, Record 3)
      Child Tag 1 (Record 1, Record 2)
      Child Tag 2 (Record 3)

    Bear does this by simple parsing tag names for slashes and extracting the tag structure from that but I’ve seen other apps implement it in other ways. Keep It does something that’s similar and creates some sort of implicit hierarchy from a flat list of tags. When you select a tag to filter by the tag panel then filters out any tags that aren’t designated in other items with the tag selected so you very quickly create structure through boolean unions.

    Regardless, assuming Tap Forms’ scripting is capable of parsing regex expressions, assigning and removing tags programmatically I think the functionality I’m looking for could be implemented that way. I’ll definitely take a look at that example and think through your suggestion further, I think I’m still missing a little contextual experience with the application to entirely understand but it sounds like it’s worth a try. Thank you!

    Tap Forms seems like an awesome system, while not quite as flexible as I would like for some things, I certainly realize I may be an outlier on how I want to use it. With some care in how I design things and a certain amount of clutter I think its worth the investment and will work for me.

    My goal was to move away from AirTable to something more native to the platforms I use every day and to escape the limits by subscription tiers and Tap Forms achieves both goals and does so quite well overall.

Viewing 15 results - 1,771 through 1,785 (of 2,952 total)