Search Results for 'script'
Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Search › Search Results for 'script'
-
AuthorSearch Results
-
June 25, 2019 at 4:58 PM #35196
In reply to: Printing Tables
Brendan
KeymasterA Table field won’t actually print out on the “Table of records” layout. Tap Forms won’t print tables within tables. So that’s why it’s not showing up for you. You would have to make a Script field that perhaps concatenates the contents of your Table field and returns whatever content you want into that field which would display in your report.
June 24, 2019 at 10:15 AM #35132In reply to: Adding a calculation field for duration of service
Brendan
KeymasterHi David,
I’m glad you got it working now.
You were mixing a Script field with the Calculation field formula I provided.
Thanks,
Brendan
June 24, 2019 at 1:56 AM #35129In reply to: Adding a calculation field for duration of service
David Goodwin
ParticipantHi there,
,amy thanks for your reply.I’m still not sure how I construct the script in the box to make this script work.
I keep getting error repsonses.
Could you show me where the field I want to use as a start date (on line 2) should sit within this script.
many thanks
Attachments:
You must be logged in to view attached files.June 17, 2019 at 10:50 PM #35108In reply to: iCloud sync issues
Sam Moffatt
ParticipantCould you use the CouchDB based sync instead? I’ve shifted everything over as soon as it was available but this requires setting up a CouchDB server. I have an iMac at home that is always on and I run as my CouchDB server but this does mean that when I’m not at home my changes don’t get automatically sync’d from my devices like they would with iCloud.
One other thing I’ve been wondering about for a while now is if there is much interest for having a TapForms specific hosted CouchDB set up. Pay as you go, probably one dollar per gigabyte stored per month (most used storage for the month; probably a minimum of $5/month to deal with CC fees and the like), set up with a standard SSL certificate and georeplicated backups. For the most part I rely on my own internal network and VPN into it but I’ve been wondering about setting this up more formally and then seeing if there is external interest.
A feature that I’d like to see if I can get interest in is being able to provide more uniform support for backups. I have my own scripts that I run internally that do two different sorts of backups (one is like Time Machine and another tries to get every single change). Backups would be charged on a similar cost per gigabyte used model though I wouldn’t want to launch that until there was a user interface for it that doesn’t exist right now. I’ve already used my backup system to restore a field script that was thoughtlessly nuked so I know it works but I’d be looking to build a UI around this. These backups are brick level backups that backup individual records which means you can restore a single entity in Tap Forms (such as a record, a field, a script or even a form) without having to bring the entire Tap Forms document along.
Is there any interest in that?
June 15, 2019 at 10:39 AM #35096In reply to: Calculation similar to VLOOKUP (MS Excel)
Sam Moffatt
ParticipantIt’s actually mostly templated from the snippets, the
child records loopsnippet looks mostly like thevlookupfunction and the prompter snippet was in the other form script POC.I don’t have dedicated time to commit to extra work, I don’t mind helping ad hoc on the forums though. Something like this is also generically useful and interesting enough.
June 14, 2019 at 11:07 PM #35089In reply to: Calculation similar to VLOOKUP (MS Excel)
Sam Moffatt
ParticipantThis will work, it requires using script field instead of calc field but it’s not that bad. You need to tell it the value you want to lookup with, the “join” field (table or link to form), the search field to match the lookup value on and then the field to return.
Create a new form script called “vlookup” with the following contents:
function vlookup(lookup, join_field, search_field, return_field) { var entries = record.getFieldValue(join_field); for (var index = 0, count = entries.length; index < count; index++){ var target = entries[index].getFieldValue(search_field); if (target && target == lookup) { return entries[index].getFieldValue(return_field); } } return ""; }Then create a script field to map the values across:
form.runScriptNamed('vlookup'); var addresses_id = 'fld-34e22de8a7cf438fb4a83146108f0511'; var address_name_id = 'fld-f05929829d674141aaed98efe11e29f1'; var street_id = 'fld-04ec2a23e3554770b3e1f1d771157dd6'; var primary_address = record.getFieldValue('fld-9b2865aa57b74b70bd4421b27081d65b'); vlookup(primary_address, addresses_id, address_name_id, street_id);In the script editor, select the fields from the linked form and use the “ID” button instead of double clicking them to get the
varsyntax. You’ll want to change the last field to match your fields across.I’ve attached a sample archive which should demonstrate what I’m talking about. It also has another form script using a prompter to handle the address change but for some reason the script fields aren’t updating afterwards, you have to manually press refresh on the record.
Attachments:
You must be logged in to view attached files.June 12, 2019 at 1:50 AM #35057In reply to: Key Word Automation
Brendan
KeymasterSo you want all the spaces to be replaced with underscores within the value of a field? Is that what you’re wanting?
If so, you can use a Script field with the following script:
function Hash_Tag() { var keyword = record.getFieldValue('fld-6ec7c1fdcc094a1c8d935b36158cb0a8'); var hashTag = "#" + keyword.split(' ').join('_'); return hashTag; } Hash_Tag();Replace the
fld-...bit with the field ID from your own Keyword field.Attachments:
You must be logged in to view attached files.June 8, 2019 at 10:10 PM #35035In reply to: Learning Javascript
Brendan
KeymasterHi FourD,
You can find out about what JavaScript is used in Tap Forms from this link:
But it’s more of a description of the language and not a tutorial.
The Scripting topic in the manual and the API documentation should give you an idea how to go about things specifically in Tap Forms:
https://www.tapforms.com/help-mac/5.3/en/topic/scripts
You can basically use any JavaScript tutorials that are not specifically geared to programming a web browser. Or at least if you do, you can ignore the parts that refer to the DOM (document object model). Tap Forms uses JavaScript, but basically just for it’s syntax and functionality in the general sense. There is an API I added to it which gives you specific functions you can call that specifically work on your Tap Forms data.
Here’s the API:
https://www.tapforms.com/help-mac/5.3/en/topic/javascript-api
Thanks!
Brendan
June 8, 2019 at 5:19 PM #35034In reply to: Home inventory new for old calculation
Sam Moffatt
ParticipantThe
0.02number is your inflation rate, 2% in this case. Just change that constant to what ever you want it to be and refresh your record to get the updated value. If you tick the box for running only once it’ll stick. You could put an extra field in the form for the inflation rate you want to use for the record.With scripting you could do something a little more complicated and with some join fields you might be able to do something where you have a form with records per year and the interest rate you want to set.
June 7, 2019 at 2:54 PM #35029Topic: Learning Javascript
in forum Using Tap Forms 5FourD
ParticipantDoes anyone have any suggestions for references on learning the version of Javascript that is supported by TF?
June 6, 2019 at 12:21 PM #35026In reply to: Script video examples please.
joe omalley
ParticipantThanks Brendan, a step by step with the proper syntax and explanation in order to grab a value from a field in one form and insert it into another form. I’m just trying to get a visual utilizing Tap Forms scripting technique.
I can’t grasp the written instruction of how to use java script in Tap Forms without seeing it in use inside the Mac version the program.June 2, 2019 at 1:03 PM #35009In reply to: Images in Search
Brendan
KeymasterYou could just add a Script field, then click the Script Editor button to edit the script. Then copy and paste the code in my above example and replace the “fld-….” value with your own photo field ID. It’s right there on the Script Editor screen. Then save it. You’ll now have a field that tells you the number of photos in your Photo field. Now you can build a search on that.
You don’t really need to know how to write scripting code. Just a copy and paste.
June 2, 2019 at 11:52 AM #35007In reply to: Images in Search
CollectorM
ParticipantOh, unfortunately I don’t know anything about using a script or writing one.
But thanks for taking the time to answer me, I appreciate that.June 2, 2019 at 2:56 AM #35006In reply to: Script video examples please.
Barry Shevlin
ParticipantMight I please add my support to this request for a scripting video(s)? That would be very useful.
June 1, 2019 at 9:34 PM #35004In reply to: Images in Search
Brendan
KeymasterHi CollectorM,
Yes there is. You can do that by using a Script field that returns the number of photos in your Photo field and then search the form for where that field value is 0.
Something like this will work if you add a Script field to your form:
var case_cover = record.getFieldValue('fld-e2cf02f376864a7cb9f090e4a597f3e4'); if (case_cover) { case_cover.length; }Use the “fld-” value from your own form’s Photo field. You can get that from the Script Editor.
Hope that helps!
Brendan
-
AuthorSearch Results