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
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.
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.
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.
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
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
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
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…
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
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
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.
Hi Brendan!
Happy new year!
I’m not sure, if this is a bug of it I’m stupid…
> I have a date field.
> I want to use the date in a script.
> Finally I need the date in YYYY-MM-DD Format
For this I like to use the ISO-Format.
.”getFieldValue” returns:
Sun Apr 19 2020 00:00:00 GMT+0200 (CEST)
If I now use “.toISOString” I get:
2020-04-18T22:00:00.000Z
As you see, the date is changing to one day before, because the time zone is ignored.
As a workaround I use
“date.toLocaleDateString(‘ja-JP’, {year: ‘numeric’,month: ‘2-digit’,day: ‘2-digit’}).replace(/\//g, ‘-‘)”
But this seems not to be the most elegant way. Any other ideas?
Regards, Eddy
I looked into the DataMatrix format a little closer and although Apple has a definition for it in their CoreImage Filters, it is not yet supported. I tried implementing the code in a similar way that I implemented the QR Code generator, but I got this error:
inputBarcodeDescriptor of type CIDataMatrixCodeDescriptor is not yet supported
So I won’t be able to add it. At least not without investing in some other barcode generator library that might support it.
Hi Eddy,
It’s not possible right now because all of the code to fetch the location coordinates for a given address exists only on the screen that shows you the map. There’s also a delay in fetching the geo coordinates because another process has to be kicked off to call to Apple’s servers and wait for a response. It would require a new script API to support triggering the calls to Apple’s Core Location framework. I’ll add your request to my requests list.
Thanks,
Brendan
Hi there!
So, I wrote a little script to fill the location field with the information already stored in other fields. It works finde, BUT: After the location field is automatically filled now with the text, I have to clic manually on the loacation field to force to search and store the geo-coordinates.
QUESTION: Any way to let the location field be automatically completed with the geo-coordinates? As far as it works half-automatically (I just have to make a stupid click) I am full of hope…
Regards,
Eddy
function fill_locationfield() {
var street = record.getFieldValue(‘xxx’);
var postcode = record.getFieldValue(‘xxx’);
var city = record.getFieldValue(‘xxx’);
var country = record.getFieldValue(‘xxx’);
var lacation_field_id = ‘xxx’;
var text_for_locationfield =
street + “, ” + postcode + ” ” + city + “, ” + country;
record.setFieldValue(lacation_field_id, text_for_locationfield);
document.saveAllChanges();
}
fill_locationfield() ;