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,356 through 2,370 (of 2,950 total)
  • Author
    Search Results
  • #36766

    In reply to: x-callback-url

    Brendan
    Keymaster

    I’ve added document.getID(); to the next update.

    But also you can do record.getUrl(); to get the whole link to the record. That’s in the online docs for the Script API.

    #36763

    In reply to: x-callback-url

    Sam Moffatt
    Participant

    You just make that line the script entirely or if you want to wrap it in a function, put in return at the end. The function scaffolding is there to help you wrap things a little easier and make it so that you can return early easier but it isn’t purely necessary. For something truly as simple as this, you don’t need it.

    Attachments:
    You must be logged in to view attached files.
    #36760
    Sam Moffatt
    Participant

    To move from one form to the other, you need to map the field ID’s across. Even if you duplicate the same form, the field ID’s are different between the forms. Essentially you need to go through each of the forms and grab the ID’s.

    The simple way of doing this is to use record.getFieldValue() to get each of the values, then create a new record in your target form with var newRecord = form.addNewRecord() and then with the new record, set the values and save: newRecord.setFieldValue(). A slight variation on this is to use a dictionary and newRecord.setFieldValues() which might look a little better. I’ve done something like that to merge fields from a child record and it’s parent record to create a grandchild record, some of that script is elsewhere on the forum.

    If you’re up for a bit more of a challenge, you could take this a step further and use some of the more interesting parts of API. If you checkout the JavaScript API documentation, you’ll see there is a couple of things that could help you automate some of this via a form script:

    – There is a document.getForms() that you could use with prompter to ask which form to move the currently selected record.
    – There is a form.getFields() that you could use to get the fields in the form.
    – There is a field.name for each of those fields that you can then use to map 1:1 fields from the first form to the second form and then use field.getId() with record.getFieldValue() and newRecord.setFieldValue().

    Assuming you keep the field names consistent on both sides (and if you’re missing a field, you raise an error!), then you could use the methods above to make a generic record copy script. To productionalise it I’d really, really want something that confirmed the field mapping and asked the user (prompter use case again), I’d avoid automatically deleting the record (hello data loss!) and I’d probably want to have a special field that links me to the new record in the new form so that I can quickly get to that record from my old one, verify it’s all correct and then manually delete the old one.

    #36758
    Sam Moffatt
    Participant

    Wrap the search term in quotes and it might find it with the slash in it.

    I commonly have a section heading for small fields like this at the bottom of the record, either called “Calcs”, “Join Fields” or “Linking Metadata” that I hide these calculation or script fields in. This helps me split out these sorts of fields that I use for search purposes (like combining shipping tracking numbers together or computing alternate order ID’s) and then collapse the section to hide them. You can also hide the collapsed section heading field to make it all disappear entirely without having to toggle the hidden state on each field. For me collapsing the section heading is enough but depending on your environment you might be interested in hiding it as well.

    #36757

    In reply to: x-callback-url

    Sam Moffatt
    Participant

    On the Mac, there is a “Copy Record Link” option to get the link back to the record in the UI. Something like that would work as an addition to the record menu on iOS.

    That said to get you out of a quick bind, you can use a script field like this to generate a link in your forms manually:

    'tapformz://record/view/db-14f9b6b609904da9b6fb89e4df20d42c/' + form.getID() + '/' + record.getID();

    Unfortunately there is no document.getID(), so you’ll have to get the document ID from the sync page and put your document ID in. That should generate a URL you can copy and paste from.

    #36750
    john cesta
    Participant

    I agree on the pick list thing and I use this method for other things, certainly works great.

    But with my brain and the importance of the prospects and not forgetting about them or mistagging them etc I need to have them in a separate standout form for quick easy simplified access.

    The way I have it now is ok and it’s not a big hassle to move them over but I think I’ll take the challenge and try and create a script to copy them over.

    Attachments:
    You must be logged in to view attached files.
    #36749
    Richard Riffle
    Participant

    Thanks Sam and Brendan. I took your advice and got a refurbished Mac mini to run Tap Forms on and was able to write a working script within a couple hours of getting it delivered. I doubt I’d ever been able to do so just using the iPod/iPhone. I’ll probably be bothering you with scripting questions once I get further along. Thanks again.

    #36747
    Brendan
    Keymaster

    Hi Scott,

    A Script is not required for this.

    Tap Forms will generate an average from a set of records for you.

    If you’re using the Mac version, switch to the multi-column list view, then click the Sigma button to show the Calculations row. Then beneath your Selling Price field, click the popup button. Choose Average and you’ll be able to always display the average of the selling prices for the properties.

    There’s an equivalent way to do it on the iOS version too. Go to the Field Options screen when editing the field in your form template, then set the Calculation Summary option to Average.

    If that’s not what you’re looking for, let me know.

    Thanks!

    Brendan

    #36745
    Brendan
    Keymaster

    @John, well, you can accomplish the same thing with Saved Searches. Instead of moving records from one form to another where one form is a list of prospects and another is a list of members, each with the same kind of information, just create a field you use as a sort of Contact Type where you have a Pick List defined with the different types (e.g. Prospect, Member, etc.). Then create a Saved Search for each of those types. Now when a Prospect becomes a Member, just switch the Contact Type and you’re done. With a Saved Search for each Contact Type, you can then filter your master list and show only the prospects independently from the members, etc.

    And when you select a Saved Search to view only those specific contacts, the export records or email function would work on just the set of records found.

    Yes, you could also write a script to copy the records from one form to another if you like.

    #36742
    Scott MacLennan
    Participant

    Let’s begin with I know ZERO about scripts but it looks like a script would be the most effective way to do something I want to do. I have a database of sold houses, simple enough. I need to find a way to get the average price of a home from the “selling price” field in my database. Is a script the best bet or ???? Newbie, total Newbie and as I said, I know nothing about scripts.

    #36740
    Sin Cohen
    Participant

    Hello,
    I am looking at options for an inventory system for my personal business. It has grown past the point of convenient bookkeeping with a spreadsheet. The main issue I face is that I have a bunch of different products with technical specifications I like to list out in the inventory list, and then specific instances of each of these products that have unique serial numbers. It seems pretty easy to add any number of descriptive fields to a product listing, but serial number tracking seems less obvious. To be clear, I am not looking for a hand-out or built-it-for-me template. I am happy to do the hard work of learning the software and building the database I need. But before I head down that long path I want to know if Tapforms can even do what I’m trying to do.

    I tested out FileMaker, it has an inventory Quickstart template that does what I want right out of the gate. But I found even basic customization of the template they provide to be very unintuitive, so while filmmaker remains a possibility I am looking for other options first.

    So the main function I am looking for is to be able to define “Product A” with all its technical specifications, then define one or more “instances” of “Product A” each with a unique serial number. Each instance of “Product A” would be calculated (simple count function) to provide an inventory overview- without having to re-list each instance of “Product A” as if it were a separate product.

    Ideally I would then be able to list given instances (by serial number) as sold, at which point there would be some basic sales record info attached to that instance and that instance would be removed from the inventory count for that product.

    So again, not looking for a cut and paste solution, but is this a system I can build with tapforms or is it not the right software for the job?

    Thanks,
    s

    #36724
    Sam Moffatt
    Participant

    I personally wouldn’t want to write a script without a physical keyboard regardless of platform and I don’t think I’d like to do too much hard core editing on the iPhone/iPod form factor. There are two reasons for wanting an actual keyboard: being able to quickly type special keys and screen real estate. There’s a detailed explanation of both at the bottom if you’re interested. Fortunately you can get a cheap Bluetooth keyboard and that will help you solve both of those problems.

    That said sooner or later I’d suggest grabbing a desktop to work on so that you can use a web browser easier and more importantly Google! You’re learning, you’re going to want to easily copy and paste stuff from the web and try things. On any iOS device, that’s going to be cumbersome. The new iPadOS stuff might make it better but at the cost of screen real estate again. On a Mac you can Command+Tab between two apps to easily copy and paste code to try. It’s a little easier to reason about importing stuff from the forums with a Mac device in a way that isn’t quite as straight for on iOS due to limitations there.

    I mentioned elsewhere (or at least thought I did) that you can go to OWC/macsales.com and pick up a cheaper, older generation, second hand Mac Mini that likely has more than enough power to run Tap Forms, hook it up to a monitor or even TV, get a keyboard and mouse (potentially Bluetooth again) and start working. There is an extra cost but if I wanted to learn, I’d prefer to do it on the desktop rather than on the phone. And if you buy the app on both platforms (you do need to buy for each of iOS and Mac), you can use the P2P sync to keep both the phone and desktops up to date (make sure both are online at the same time!).

    Detailed reason why keyboard:

    The first one is more due to how programming languages rely on keys that you don’t normally type when you’re writing text: ,, ', ", /, =, ;, |, &, !, {, }, [, ], ( and ). Writing these on a keyboard is an extra shift key for many of them however on iOS you need to go to the first layer of numbers and symbols, then sometimes the second layer and sometimes (like the quotes), need to long tap. On top of that the iOS keyboard by default will want to insert “smart” quotes and that’s going to mess things up in weird and wonderful ways if you don’t remember that long tap the quotes. I’ve been through that nightmare before with calculation fields and warn about it frequently as an iOS hazard. I also have multiple languages enabled, so every so often I tap the change language button which is right next to the symbols/numbers button and then it’s a pain to fix that. A real keyboard avoid most of these hazards and impediments.

    The second is a little less obvious early on: you want to see as much code as you can. On my iPhone 7 with the keyboard up I get:

    – landscape mode: ~9 lines of text and 64 characters per line
    – portrait mode: ~21 lines of text and 33 characters per line

    When I take the keyboard offscreen I get:

    – landscape mode: ~16 lines of text (7 more lines!)
    – portrait mode: ~32 lines of text (11 more lines!)

    If you have a dedicated keyboard, you can get these lines back that help immensely in being able to understand. I would go for landscape mode because that gives you more character width even though it’s obviously half the lines of text. What I end up seeing happening is that in portrait mode, the lines wrap more frequently and this cuts down the effective number of lines that you have visible whilst making it harder to read due to the wrapping. For perspective the old DOS terminals used to supported 80 characters per line and 25 lines.

    This ended up a little wordy, hopefully the details help.

    #36723
    Richard Riffle
    Participant

    OK, I’m interested in writing scripts but have no Javascript experience. Further, I don’t have a Mac, only iPhones/iPods to write and debug the scripts. Is it feasible to learn to write scripts this way? Are there additional tools available for iPhone/iPod which would help? Any other options? Or should I buy a Mac?

    I have made a few brief attempts at using some of the included script fragments in Tap Forms and was able to retrieve field codes but couldn’t use those to retrieve the value of a record. The experience suggested to me that I may need a better environment to write and debug the script… among other things.

    Thanks in advance!

    #36722
    Daniel Leu
    Participant

    I don’t really see the motivation to move records since you can hide them using saved searches. With a script you could even hide linked records where the parent is hidden.

    Using a script you should be able to create new records in another form and copy the data over.

    Cheers, Daniel

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

    #36714
    john cesta
    Participant

    Has anyone messed with the movie script to get the characters/cast into tapforms?

    I’ve tried some various things but not been able YET to do this.

    Thanks

Viewing 15 results - 2,356 through 2,370 (of 2,950 total)