Populate list from entries in other library

845 views
Skip to first unread message

Bear lord

unread,
May 3, 2017, 3:53:50 PM5/3/17
to mementodatabase
Hello! 

First of all I would like to thank the developers for this amazing app. I have been using it for a while now and it's been great so far. I have the pro version for my entire small team. 

I have a question. Is there a way to auto-populate entry items for the types of fields that support it (single-choice list, multiple-choice list, checboxes, etc.) from data in another library?

We organize field trips for schools, where we take students to a natural research facility in the rain forest. 

Here is an example of what I want to do. I have a library named "Students" where I have basic information about the students, contact info, etc. Then I have another library named "Field trips" where I manually add all the students from my Students library as a checkbox. On each field trip I mark the students that went inside the bus. I have different types of "field trip" libraries, depending on the kind of field trip.

I have tried using the link to entry field, which works fine but it is not as convenient as a simple check box, since we have to look for every student and it can be confusing.There can be 30-40 students per field trip and that has caused issues in the past because I missed to link one of the students. The check box alternative is simpler in my opinion since I always put the check box "checked" by default and I only have to un-check the missing ones. Which could work also by a link to entry and only look for missing students, but again it is not as effective as going one by one and just leaving the check if they get inside the bus when we call them or un-check them if they are not there. 

I hope it makes sense. It looks like it can be done with triggers and scripts. Would really appreciate some guide on how to achieve this.

Thanks! 


Bill Crews

unread,
May 4, 2017, 5:04:01 PM5/4/17
to mementodatabase
Yes, I would have suggested using a related library, but if you really prefer choice fields, there is no API I the Memento JavaScript Library for adding those.

However, there is a Memento User who has posted in this forum about using a template to load, among other things, choice field items. I suggest you search in this forum for some combination of "items" and "template" and maybe "load", and you'll likely find his/her posts about the technique. I'm sorry I forgot who posted it.

Message has been deleted

Mr Mukura

unread,
May 5, 2017, 10:04:56 PM5/5/17
to mementodatabase
Message has been deleted

Mr Mukura

unread,
May 5, 2017, 10:25:09 PM5/5/17
to mementodatabase

Bill Crews

unread,
May 6, 2017, 1:36:39 AM5/6/17
to mementodatabase
The link you posted is for Autofill from Memento libraries. Bad timing, though, as with 4.3.0 of the mobile edition, Memento now supports Custom Data Sources, which is precisely that. See http://wiki.mementodatabase.com/index.php/Data_Sources and note the example.

However, this does not address the issue in this thread; what was requested is to load not library field values, but choice field items. Autofill will not assist in accomplishing that.

I tried your previous link, but it took me nowhere. I think that guy was parsing the encoded template file and extracting metadata -- pretty far out there, if you ask me -- but it could provide a solution for this thread.

Bear lord

unread,
May 6, 2017, 1:08:16 PM5/6/17
to mementodatabase
Thank you both so much for your feedback. 

It looks like the solution was right in front of me the whole time. I feel a bit ashamed that I didn't notice this before. I wasn't aware that using the link to entry option allowed for long-pressing an item from the other library and then just select multiple values at once. I used to go one by one. This works great for me. I would still like to be able to fill in list entries by scripts though, so I will keep an eye on future API features. 




Bill Crews

unread,
May 6, 2017, 6:51:38 PM5/6/17
to mementodatabase
I assure you I've done the same kind of thing. In my case, it was quite a while before I realized that you could multiselect entries and then click on the pencil icon to edit them all at once, so long as the edit I wanted to do was one that Memento allows in multiselect mode.

Bill Crews

unread,
May 9, 2017, 1:41:12 PM5/9/17
to mementodatabase
PLEASE DO NOT SEARCH FOR HOURS! If you can't find it, get back to me.

The name I forgot was Coucinha Palavrante. Read the discussion at...

https://groups.google.com/forum/m/#!searchin/mementodatabase/template$20file/mementodatabase/xzRkVg2IoVE

Bike Park SA

unread,
May 10, 2017, 1:47:21 AM5/10/17
to mementodatabase
Bill

All I could find is the pissibility of Coucinha Palavrante writing a parser to achieve this?? Whatever a parser is :-) There is actually no non-programming way or inthe Memento interface to do it

Bill Crews

unread,
May 10, 2017, 2:53:00 AM5/10/17
to mementodatabase
Well, yes and no. Coucinha developed a fairly deep understanding of the format of template files after reverse-engineering them. If you ask Coucinha, I think you might learn that one could edit a template file, restore it, and build choice items.

Where the parser comes in is that, if you know the format and how to manipulate it to do what you want, you could write a program to find your way around inside a template file and automatically create the choice items you want. So, if Coucinha told me the format in detail, I could probably write such a parser, but we didn't do that, and it isn't a good use of our time, since the format of a template file could change with mobile edition 5.0. This is all reverse-engineering of undocumented stuff.

Now, risking being a little religious, one could imagine programmatically creating your own choice items, your own fields, your own relationships, and thus your own libraries at will. This is all called metadata. But in my opinion, programmatically computing and/or setting FIELD VALUES (data) makes sense, while changing the DATABASE STRUCTURE (metadata) pragmatically is not really wise. Of course, you may disagree with that.

Reply all
Reply to author
Forward
0 new messages