Library Groups

49 views
Skip to first unread message

bacci...@gmail.com

unread,
Dec 19, 2016, 3:25:27 AM12/19/16
to mementodatabase
Library groups don't seem to be working at all.. 

On the desktop version they simply don't exist. And on the mobile version they dont work. It seems its possible to put a library in a group only if I create a new library on the spot, but I cant add existing libraries to a group.... mmmm.

Guys you need to keep things consistent, all these bugs and discrepancies between desktop and mobile starting to seriously hinder performance. 

bacci...@gmail.com

unread,
Dec 19, 2016, 3:32:13 AM12/19/16
to mementodatabase
I was able to add libraries to a group in the mobile version through the use of Gdrive. First linking each library individually and then selecting each library individually to be added into the group. 

Needs improvement! 

Eugene Kartoyev

unread,
Dec 19, 2016, 4:18:40 AM12/19/16
to mementodatabase
I didn't have problems with JS.
NaN means "not a number". How do you calculate X? There must be a mismatch of types ocurring somewhere. Can you provide the algorithm of X calculation?

Not clear what is "cannot add the existing library to a group"... I can move the existing libraries between groups. Is it what you are trying to accomplish?

Eugene Kartoyev

unread,
Dec 19, 2016, 5:11:50 AM12/19/16
to mementodatabase
Alessandro, unfortunately I can't respond to email - my email agent messes up Javascripts.

Now, you wrote:

1) This one looks fin­e on desktop but the ­output comes out 2 ti­mes on android

var a = field('Propri­età')[0];
var b = field('Propri­età')[1];
var c = field('Propri­età')[2];
var z = field('Indivi­so');
var x = ' ';­

if (a && !b && !c) {­
­ x = '0';­
} else if (a && b &&­ !c) { // Thi­s block calculates '%­ Margherita'
­ x = '50';­
} else if (!a && !b &­& c) {
x = '0';­
} else if (!a && b &&­ !c) {
x = '100';­
} else if (a && b &&­ c) {
x = '25';­
} ­

if (z) { x = '16.67'­; }


2) This one is fine o­n desktop and NaN on ­android

var x;­

x = 'EUR '+ (field('C­anone')*12)*(field('%­ Margherita')/100); ­ // This one uses­ '% Margherita' to ma­ke a simple math calc­ulation. 'Canone' is­ a currency field.
---

You make X a string field by including numbers in quotes.
---

I'd write:

if (z) 16.67;
else if (a && !b && !c) 0;­
else if (a && b &&­ !c) 50;­
else if (!a && !b &­& c) 0;­
else if (!a && b &&­ !c) 100;­
else if (a && b &&­ c) 25;­


---
No need for X, no need for ''.

And the same about the second field, try if this works:

---

'EUR '+ (field('C­anone')*12)*(field('%­ Margherita')/100);

---

Seems to be working fine on my tablet. Save changes before checking.
Try avoiding non-letter symbols in field names - write 'Margherita', because '@#$&*%=@#$&' etc. may cause confusion in calculation fields, for example.

Eugene Kartoyev

unread,
Dec 19, 2016, 5:41:56 AM12/19/16
to mementodatabase
Bill, I also get confused on where to respond. So, I take the toppest thread. I prefer to answer in this chat so my email doesn't mess up JS (it adds invisible anchors and destroys code, making it impossible to copy), and so everyone can contribute if they have some guesses.

I remember, one of the users also had that duplication problem with calculation of datediff.

Now, I can track it that it happens on some devices when syncing to Google Drive. I can't reproduce it, but I wonder if it happens because

1. there are problems with naming fields, like if you start a field name with a + or %, then Ģoogle Sheets confuses names for math operations, or --
2. Google Sheets just doesn't work on some devices appropriately. (Android bug? Alien symbols in gmail account names?)...

In any case, one needs to rework the data to make it as "edible" for all Android components as possible.

Bill Crews

unread,
Dec 19, 2016, 6:02:01 AM12/19/16
to mementodatabase
You don't need the semicolon, either. (I missed the email, but this is apparently a JavaScript field script.)

As for consistency between mobile & desktop editions, we are in a period, while the desktop edition is still new, when both editions are being enhanced, and the desktop edition is being upgraded with features in the mobile edition. In fact, I'm not sure, but some features may be added first in the desktop edition and later caught up in the mobile edition.

A small development group is putting its shoes on after the race has begun. It is unfortunate, but that's what we have for a time. Presumably, the editions will ultimately coalesce and conform to each other.

However, the platforms ARE different, and mice don't work like fingers. There may be features or implementations that will always work tablet-like on the tablet and desktop-like on the desktop.

Eugene Kartoyev

unread,
Dec 19, 2016, 6:13:20 AM12/19/16
to mementodatabase
I guess, consistency wouldn't be possible as long as the app uses Google Sheets for sync and its counterpart uses a memento cloud.

NaN definitety occurs due to that duplication happening in Android. Therefore JS working fine. Now, the task is to detect why the duplication. That's the Google Sheets sync meddling rather than Memento, in my opinion.

I'd unsync everything and verify consistency in names first. Re-write scripts **manually** and if necessary, try to re-create fields under different names, and sync only after everything works fine in Android.


As for library grouping problem - still not clear.

Bill Crews

unread,
Dec 19, 2016, 6:14:02 AM12/19/16
to mementodatabase
Yes, Eugene, I agree. It is easy to forget that Memento field names can be almost any UTF-8 string, but most other tools, including JavaScript and Google Sheets, have more restrictive requirements. When developing only for myself, I use camelCase for field names. But for templates or shared (Team or Business) users, I use whatever will be the most readable, and then I sometimes get in trouble with Sheets or some other export target. In JavaScript, I used to use object.propertyName to refer to properties, and it works fine for my camelCase fields, but not for the others! Better to use object['property name'].
Reply all
Reply to author
Forward
0 new messages