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,831 through 1,845 (of 2,952 total)
  • Author
    Search Results
  • #40880
    pierrot_rennes
    Participant

    Hi,

    Is it possible to colorize the lines in multicolumn mode according to a check box?
    A script?
    I have a collection and I would like the row of a record to be colored if the check box is activated for each record
    Or even better depending on a value 1 or 2 or 3 in a field, the color would be different
    Unless there is another solution?

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

    In reply to: Watched TV Shows

    Sam Moffatt
    Participant

    Looks like you’re missing the trailing slash. When I go to IMDB, it adds the slash for me and the regexp for the script is looking for the final slash. Try https://www.imdb.com/title/tt0185906/ instead.

    #40868

    In reply to: Watched TV Shows

    pierrot_rennes
    Participant

    Hi,
    I imported the Watched TV Show form but it doesn’t work.
    Same problem as previous posts.
    When we launch the script, it inserts a new recording only marked NO (example: the Band of Brothers file – https://www.imdb.com/title/tt0185906).
    No information from the chosen TV show on IMDB
    In the script, I put my IMDb Api key in quotes otherwise there is an error in the script.
    When we launch the script, no file is inserted except a “No”
    See my screenshots in case I made a mistake.
    thank you in advance

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

    In reply to: Date form YYYY

    Sam Moffatt
    Participant

    Yeah, I think it was added to Tap Forms 5.3 earlier this year. Tap Forms 3.5.20 is the much older version that is still available for folks who haven’t upgraded yet.

    Tap Forms 5 added so many new features such as new CouchDB based replication (my favourite feature), support for scripting with Javascript and built in charting capabilities.

    #40853

    In reply to: Time Zone Fun

    Sam Moffatt
    Participant

    Try changing the Z to be +07:00 or similar. Tap Forms internally stores the dates in UTC+0 but will convert to your local time zone. Alternatively use a form script to change the time but probably best to do during import.

    #40795

    In reply to: Picklist in all forms

    Sam Moffatt
    Participant

    I don’t believe you could a single list, though if you put the states in a form you could export and re-import the form for each document. Each document is its own standalone document store without anything shared between documents. You could also potentially automate it with a script that pulled from a location and added/removed states.

    #40791

    In reply to: Picklist in all forms

    Chris Medeiros
    Participant

    Hey Wolfgang,

    Okay. You’ve tapped out my expertise on the topic of Pick Lists. I cannot give you a definite yes or no. I suspect it’s no, but maybe there’s a script that can be written to accomplish your goal. I don’t know. Hopefully, someone with more Tap Forms experience will be able to supply you with a better answer.

    I can think of a possible workaround. Do you have a form that contains a record for each Federal State? What if you export the records from your Federal States form, import it into your 2nd Document’s Form and then create a new Pick List in that Form using the “Use Values from field” option. Could that work?

    #40749
    Sam Moffatt
    Participant

    You could use a form script to create a pivot form and generate the data yourself. The API should have enough power to create a new form based on your current form and you’d just add fields yourself to an existing set of records.

    #40748
    Rocky Machado
    Participant

    Hi Brendan – I have a couple of questions. Have the following methods been deprecated. form.getRecordsForSearchTerm() and record.setRecordColor() It doesn’t show up in the IntelliSense. Also, in the future will you being adding a feature to recalculate a form via the javascript API?

    Oh, I’m running version 5.3.11 (Build 962)

    thanks,
    rocky

    #40720
    Daniel Leu
    Participant

    I would try something different: Save the image into a Dropbox folder, then have an AppleScript get the URL link and launch a Form script using the tapformz URL and use the shared link (and whatever else you need) as a parameter. Then in the Form script, you can create a new record, add data entries given via the parameter and fetch the image from the Dropbox link and attach it to the record.

    I think this should work, but haven’t tried it!

    Cheers, Daniel

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

    #40719
    Sam Moffatt
    Participant

    When you enable the CouchDB integration, Tap Forms writes to the CouchDB server in Tap Forms’ own format and sync’s that with each of the devices that are connected to that server. You can get to that data using the standard HTTP REST interface that CouchDB exposes and do interesting things with it, that’s how my TF Tools repository on GitHub works to do stuff like backups, dump document structures and pump data to ElasticSearch for visualisation (before Brendan added charts natively). All of that code is in PHP rather than Javascript because PHP is a language I’ve done a lot of code in and is reasonably portable.

    Since the CouchDB API is a standard open interface, we can see what the format is that Tap Forms is writing and whilst it’s a little opaque with the field names it’s not impossible understand the format. If we write data in the same format that Tap Forms is expecting, then Tap Forms will display the records and let you interact with them. As far as your Tap Forms app knows the record came from another instance of Tap Forms.

    I’m working on another blog post on how I use Safari to scrape this forum as I navigate it with a Tampermonkey script that writes to CouchDB. I then use Tap Forms to do my own search of the forum and create custom saved searches. Follows a similar concept where I create the structure in Tap Forms and then create records matching the structure via CouchDB’s REST API using Tampermonkey. I have a few tricks around record ID generation to make sure I don’t import something more than once as I navigate around.

    #40714
    Marc Reichert
    Participant

    Thank you for both of your answers!

    @Brendan I will keep that in mind for other projects, but here I won’t be able to import the data in bulk, because the process should be streamlined like a production line. An artwork will be captured by one person while the other will then generate all the archival details needed, then it will brought into storage and the process starts again.

    @Sam Moffatt I think I can follow your description and read your blog post but I’m not shure if I’m competent enough to modify your project to my own needs. Do I get this right that you directly inject database entries in the correct structure into the (sync)storage of TF which will then replicate to the local application data? I guess for the start we will go the manual way and create the records by hand and as it won’t be me hitting the select button some hundred times I’m not too bothered ;) But perhaps I could use this project to finally learn some JS programming.

    #40711
    Sam Moffatt
    Participant

    Yeah, function is another word for subroutine. I think the C folk went with function and that filtered down through that branch of the language tree. Etymology of language features is fun, subroutine, procedure, function, all roughly the same.

    Ok, so welcome to the not so fun part of Javascript which is the amazing dearth of simple string formatting tools. This one has bothered me on and off for a while within Tap Forms but I’ve never had a good reason to figure it out. However I had another crack at something that might work but it’s a little awkward.

    Coming from a C background there is a function called “sprintf” that formats a string. I found on GitHub a Javascript sprintf implementation and gave it a spin to see if it’d work. I did make one minor change and you can check it out on my own fork.

    Copy that forked JavaScript file and create a new form script called “sprintf” and replace the placeholder text with the sprintf.js text (the link should take you to the raw version to easily copy).

    Now for your use case where you want to embed, you should be able to use something like this:

    form.runScriptNamed('sprintf');
    payment_amount = 99.5;
    izettle_charge = 12.54;
    izettle_net_amount_received = payment_amount - izettle_charge;
    result = sprintf("Amount paid: £%0.2f\riZettle charge: £%0.2f\rNet amount received: £%0.2f", payment_amount, izettle_charge, izettle_net_amount_received);
    

    The form.runScriptNamed('sprintf') pulls in the library and defines sprintf (and also vsprintf for good measure). You’ll need to update your script to add that line. Then you’ll have to change the formatting to use the sprintf style formatting. I put in a relatively simple use case of sprintf which I think should give you the currency style formatting you’re after. sprintf uses percent signs as format markers so %0.2f says format a floating point string with two decimal places. It’ll pad to two decimal places for you as well and expand on the integral side appropriately. If you need a literal percent sign, put in %%.

    I think that should get you further along with where you’re going.

    #40707
    Victor Warner
    Participant

    Sam,

    Thank for the explanation of the use of a function. I guess it is similar to a sub-routine in AppleScript speak.

    Concerning formatting. Do you mean in the Edit Field Script window changing the Result Type from Text to Number. If so, in this case – there is no output as the ‘return’ contains a mixture of quoted text and variables.

    Sam Moffatt
    Participant

    Good to hear it worked out for you. One thing I forgot to mention is that once you have the script field working, you can set the field to be hidden so it doesn’t show up any more in the default layout. The Javascript integration gives you the ability to do some powerful stuff with Tap Forms though obviously with a slightly higher bar than a simple calculation field.

    Just curious what made you make the leap from Ninox over to TF?

Viewing 15 results - 1,831 through 1,845 (of 2,952 total)