(I’m just beginning to use Tap Forms in a more sophisticated way than I have before).
I am trying to replicate a Calculation Form, such that you enter a Value, and a Unit, and Then have a calculation (or calculations) output conversion values.
So I am thinking something like this:
Value = 12
Unit (from pick list) = “inches”
Calculation Result (in Feet) = 1 Foot
SO I am thinking something like this (but not suer if it can be done or I have the syntax incorrect or?
IF([Unit] = “inches”, [Value]/12, “N/A”)
Also, can I cascade the IFs such that I more or less replicate a complex If/Else calculation:
IF([Unit] = “inches”, [Value]/12, IF([Unit] = “yard”, [Value]*3))
Ultimately it would great to be able to utilize TWO pick lists so I can pick both the Input Units and the Output Units.
I’m not great at programming scripts in JavaScript or how to implement them in Tap Forms (yet, If I was going to do that I’d probably switch platforms and learn to create an App in Swift.)
Any pointers would be greatly appreciated.
Awesome addition! I’ve just been dismissing and re-showing the progress bar for the use case I have. Is it possible to reset the state entirely to change the total as well? It’s a little weird now where the sheet pops in and out, if I could change the total and the label then I could show it once and then update the label and total as I shift between stages of a script.
Yah even when it’s explicitly dismissed it still shows up after the script complete popup. The same script on the desktop dismisses the progress bar properly. Tapping at least dismisses the pop up though so it’s not too bad in the grand scheme of things :)
Yes, the script finished.
Tapping on the progress is closing it, otherwise it will run in an endless loop until next Christmas ??
I gave this a spin and the script finishes but the progress bar is still there. Tapping on it dismisses but it should probably disappear automatically. Same script on desktop works ok.
Hi,
first if all, Merry Christmas ?
I noticed the following behavior of the progress bar on iOS (iPhone):
Run a script
Select the script
Confirm to run the script
Confirm Script run complete
“Processing Records…” does not disappear
I took the example from the API documentation:
https://www.tapforms.com/help-mac/5.3/en/topic/javascript-api
btw.: A disable/enable option in settings
to confirm to run/run complete scripts would be a nice feature.
Hi Chris,
I’ll have to look into this issue.
In the meantime, a Script Field would do the job without this issue.
Can you please email me your form template and I’ll test with what you have?
Thanks,
Brndan
Hello,
I have 2 forms: form_A & form_B, and a script in form_A,
question: how can I, in this script, create a new record into form_B? There is no link between the 2 forms.
Thanks,
Gilbert
Siri executes scripts in a form context not a record context. Siri doesn’t have the context that Tap Forms is executing in and the intent that is being executed I believe is distinct from the main Tap Forms application. This is part of the way Apple have implemented the Siri support.
I also have struggles using Siri with clipboard access, scripts invoked from Siri don’t seem to have access to the clipboard but when I run those same scripts manually they are able to pull the clipboard properly. I’m not sure if writing to the clipboard would have a similar problem.
Maybe I‘m missing something, a basic question how to use Siri to run a script.
I am in the record edit view and want to copy a field value to the clipboard.
The script works fine by executing manually:
function Clipboard() {
var title_id = 'fld-76b2c64fccc34c20b62b7d485f5bfa28';
var clip = record.getFieldValue(title_id);
Utils.copyTextToClipboard(clip);
return clip;
}
Clipboard();
I added this script to Siri, the result is just
„.undefined“
(iOS, iPhone)
Attachments:
You must be
logged in to view attached files.
Calc and Script fields track which fields are referenced inside of them and then when those fields are changed, the calc/script fields are executed to update. Script fields have some nuance to them where you can break the detection but if you use the standard pre-supplied interface to add the fields it should be fine. Script fields in the editor will show a tick next to the names of the fields that they are tracking.
Attachments:
You must be
logged in to view attached files.
Hello,
New with TF5, I search a script example witch use a ‘Calculation field’ & an another with a ‘Script field’. When these fields are triggered ?
Many thanks,
Gilbert
I tried something here with Siri Shortcuts and trying to marshal data with the clipboard but didn’t get very far. I could get Siri to capture some voice text and location data without too many issues, I can put it into a JSON object on the clipboard and if I run the form script directly in Tap Forms it seems to work. However as soon as I go “Hey Siri” I get an error saying the app took too long and I suspect the clipboard isn’t accessible from the intent. If there was a version of the Run Script intent that accepted a simple text input then I could use that with JSON.parse to manage structured data.
I don’t think you could do that with a calculation field or standard pick list field, it doesn’t have that flexibility. The pick list setting is at the form level and realistically your values should be at the record level, that’d be a little challenging.
You could use a form script with a prompter to ask for the three values one after the other and then set the corresponding fields in your form. It’s not entirely elegant but it would be functional.
Hi Daniel,
Tap Forms doesn’t have cascading Pick Lists. So there’s no function that’ll populate a Pick List based upon the selection of another Pick List.
A Calculation field wouldn’t really help you with this anyway. If it were possible, you would have to write some JavaScript in a Field Script to do it. I haven’t tested out anything like that before. But I did recently open up access to the Pick Lists from a Form or Field Script. If it did work, you would essentially need to pre-create the Pick Lists, then set the values on them from JavaScript. Again, I haven’t tried this, but it might be something interesting to try.
Thanks,
Brendan