Hi Bob,
The general search will actually search the records within Table fields. But the Saved Search function does not.
What you can do though is add a Script Field and then pick out the information from your Table fields. That would expose the result to the parent form and then you can search on that. In your case, a simple script to count the number of checked items in your Table field and return the count value. Then you can search on that. So then you’d know which records had outstanding todos.
If you have questions that are all related, then a single post would be good. But if they’re all separate questions, then it might be better to separate them. But really it’s up to you. Don’t worry about any cultural rules. There aren’t any other than be respectful and polite :)
Oh, and I’m just one guy building Tap Forms, so I can’t always implement everyone’s feature requests, but I do my best :)
Thanks!
Brendan
I’m creating a database to track my meetings. As part of the record definition for each meeting, I have a table with a couple of checkbox fields and a text field that I’ll use to quickly add todo items during the meeting. Then later as I either complete the todos or copy them to my separate todo tracker, I’ll tick off one of the two checkboxes to indicate as much.
I’ve managed to get that all set up.
What I’d like now is create a saved search that lists all the meeting records that have one or more todo table items where both the checkboxes are unticked. In other words, I want to find all the meetings that still have unresolved todo items.
The problem is, I can’t seem to figure out how to do the saved search part. The table field isn’t even listed in the search rules menus, so it seems I can’t reach into it. Am I missing something?
If table search just isn’t supported in search (in which case, consider this a feature request), a backup plan I came up with is to add a “has open todos” calculation field that I can search, or maybe make it a checkbox field that can be toggled by a script. I’ve not gotten as far as touching the scripting interface yet (I suck at JS), so I’m only guessing that that’s possible and have no idea yet how to do it if it is. If anyone knows of something similar out there to either of these solutions that I could review and adapt, that would be great. Or if there’s some other solution that I’m totally missing, that’s also appreciated.
On a separate note, I’m just starting to use TF, still on trial actually, and I’ve got a bunch of questions and feedback. I was thinking I could just post each of them in a separate thread as I got around to it so as to make those threads easier to find in the future. But, I don’t want to break any cultural rules here… is it better to do that or to minimize the number of messages by just posting a bunch of questions in one?
Absolute beginner with scripting, even if I did something with FileMaker some years ago.
Got a basic DB with two forms, Authors (Parent) and Books (Child), with M:M relationship (an author can write many books, and a book can be written by more than a single author) that works perfectly. Authors form has just a Name field, and Books form a Title field.
Now I’d like to get a simple Child records count, just to know which author has written the highest number of books. I tried with the “child records loop” snippet by selecting the Title field, Tap Forms created the following script
function recordsLoop() {
var books_id = ‘fld-44222ad745354a45b569beec4109d33b’;
var title_id = ‘fld-d53a50ba8edd4d0fb0024e6a3f15fae2’;
var books = record.getFieldValue(books_id);
for (var index = 0, count = books.length; index < count; index++){
var title = books[index].getFieldValue(title_id);
if (title) {
// do something
}
}
return;
}
recordsLoop();
but I get nothing but [object TFFormEntry].
By the way, is it possible to have a Number field automatically filled with the number of the Child records on the Parent form?
Sorry for being so newbie :-|
Is it the case: that a date field created by a script cannot be used in a calculation field for the creation of a new date?
Hi ang,
As Daniel mentioned in his response above, you need a record. You don’t have a record in your script. You’re attempting to get a value from a form. A form has no values. It does have records though. And records have values for the fields in the form.
So you need to modify your code to either use the currently selected record by using the record keyword, or get all of the records from the form you’ve assigned to your variable and loop through them to get the values you want.
Hey guys. Maybe you can speed up my work a little. I have about 100 csv files that I want to import into one form. They are not large files, but currently I think have to manually import each one. I was hoping to be able to select all of the files and Tap Forms would just import one after another. I looked for Shortcuts, Automator, and AppleScript support for doing this, but I didn’t see anything obvious. Do you guys have any brilliant suggestions?
Thank you for taking a look at this.
Hi Bernie,
I moved your posting to the Using Tap Forms forum because your question doesn’t have anything to do with scripting.
Tap Forms does not support a one-to-one relationship. It has One to Many, Many to Many, and Join.
The iOS version doesn’t yet support the Access Controls function, which I think you’re referring to .
Thanks,
Brendan
Hello. I am new to TF. I have made a training app using iCloud for DB sync. Now I want to migrate it to a cloud solution like IBM or Apache DB. However, I do not get how to manage users in TF and external DB’s. Are there some man-pages or some videos on the topic so users can have private forms and share forms like premade information?
My model is to have users add them-selves on a logon/register page I make in HTML. They buy TF for iOS and get access to training descriptions, recipes and training log.
Hi,
In the form “Rekryteringsdjur” I have the field “Senaste kalvning, datum” (latest calving date)
which is created by a script.
Now I tried to add a new calculation field “… och betäckt, datum” (pregnancy date) but it works for some cows only and not for others and in the iphone it doesnt work at all.
Need help!
Attachments:
You must be
logged in to view attached files.
I use this whenever I need a function from my ‘script library’. I don’t care if the script is called several times. But I protect the content of these library scripts so they are not executed more than once. Here is the example of my Common script:
// Only define functions once and skip them when already called
if (typeof commonScript === undefined){
var commonScript = 1;
// here go your function definitions
}
Obviously there is a performance penalty when you have many script fields that use this include and you do a refresh of *all* records.
But yeah, sometimes it is a challenge to get a field script trigger upon a field change… I run into this as well… I usually try to have all field defines at the top of the script:
var fldName = 'fld-xxx'
...
And then in the script I just use these defined variables or constants.
Hope this helps!
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks
Daniel, This is a great idea. A question , when you say “Then in the field script, I use document.getFormNamed ..” You put this in the first field script on the other forms so they can execute the functions in ‘Common’, correct?
Do you get this first field scrip to execute automatically (by watchin a field on the form) ? or does your user have to do ‘refresh’ to get things started? I am having a very hard time getting a script to run automatically, based on a field change, I have dried a dozen ways. I need to have the user hit ‘refresh’ How do you do it ?
Thanks for you help
Bernie
I usually create a form named Scripts and place all javascript functions in form scripts (eg, Common). I try to organize them logically so I can easily reuse them. Then in the field script, I use document.getFormNamed('Scripts').runScriptNamed('Common'); to load one (or several) of these form scripts. Later I can execute whatever function I need.
-
This reply was modified 3 years, 4 months ago by
Daniel Leu.
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks
I have a situation which I don’t know if it works because of TF design or just happens to work now and maybe will not in the future.
I have a ‘Result’ field , on a ‘Entry Form’ , that can have 17 different values. I use a pick list to have the operator populate the field.
On the ‘Totals’ form I want to show a count (and percentage) of each result value. So I have a script that will loop througe the records on the linked ‘Entry Forms’ and count the ‘Results’. This script function takes an input parmater containe the ‘Result’ value I want a total for and return the appropiate value.
So rather than duplicating the script in 17 different total fields I placed the script (named CountResults) in the FIRST field on the Totals form, and then for the other 16 i just execute ‘CountResult(‘xxx’)
This only seems to work if the script (CountResults) is in the first field on the totals form.
So, is this a feature I can rely on now and in future releases, or not?
(I understand the risks if the script field changed location, etc.
Thansk
Bernie
Hello,
I’m trying to display the value of a specific field value from a linked parent form (many to many).
Name of the parent form : “structures_19_06”
Field ID value to display : “fld-33b8d7ca30f54c7f8e9974030ea1b3f0”
In script, i have added the field like this :
function Structure_Diffuseur_1() {
var nom_de_structure = structures_19_06[index].getFieldValue(‘fld-33b8d7ca30f54c7f8e9974030ea1b3f0’);
}
Structure_Diffuseur_1()
It returns thos error :
Structure (DIFFUSEUR) 1: ReferenceError: Can’t find variable: structures_19_06, line:(null)
Can you help me to correct this ?
Thank you very much
one last related question. I notice if I refresh all records, the script is getting fired and incrementing the field by 1 each time. Is there a way to bypass the script trigger from record refresh?