How to see Attributes easily

349 views
Skip to first unread message

Fernando Bravo

unread,
Sep 19, 2022, 11:28:00 PM9/19/22
to mementodatabase
Hello guys.

I developed a little company using memento database to handle quick orders mainly. It's very useful the android platform to record any new request.

So the problem is that I'm a little stuck trying to get the attributes information. I'm not an English speaker native so i would like your help if it's possible. I will try to explain the issue. Sorry if I made writing or grammar mistakes. 

I just have two libraries. #1 for customers and #2 for the inventory. 

Customer are linked to Inventory of course. And the inventory library has some attributes under Library #1. I would like to see those attributes but check in the Inventory Library #2. Under library #2 It is possible to see all the linked entries "Customers", but i would like to see all the customer name, for this specific inventory item and their attributes easily. 

Thanks for your attention. 
It's really important to me to find a solution. 

Regards. 

Bill Crews

unread,
Sep 20, 2022, 11:03:59 AM9/20/22
to Fernando Bravo, mementodatabase
This is something I've discussed a number of times over the years, and it now appears to be the time to do it again, which I'm happy to do. We have new & different users over time. There are two methods discussed below. The first is preferred in general, but if it doesn't work for you, consider the second.

First, the linking method...

Memento has a number of excellent features, but to many, the main one is the ability in the entries list of a library to use the features in the right-side (some say kabob or 3-dot) menu -- specifically Sort, Group, Filter, & Chart. To use these excellent tools, the data they work on need to be available in that library.

To make that happen, it's best to link from this library to others to access their data. Based on your message, it sounds like your main focus is on the Inventory library. So, it's best to link one-to-many from the Inventory to the Customer library rather than the reverse. A piece of inventory belongs to a Customer, and the link identifies that customer. So I recommend that you add a one-to-many Link to Entry field in Inventory to the Customers library. You probably don't want to add information twice, so in that case, you should remove the many-to-many link in Customers that points to the Inventory library.

Now admittedly, this means that your ability to use Sort, Group, Filter, & Chart is limited in the Customers library, but I have a feeling that's less of a problem for you. It's due to the way Memento linking works. Unlike a relational database, a Memento link has is directional, and the "from" side of the link has more power than the "to" side.

Second, the JavaScript field method...

If moving the link from Customers to Inventory doesn't work well for you, you can still gain visibility to data in another library by using a JavaScript field for each field you want to make visible in Inventory. Then, you can use Sort, Group, Filter, & Chart on the JavaScript fields, if you like. To do this, it is necessary to know only a tiny bit of JavaScript to get it done.

In the Inventory library, for each field you want "to bring over", do the following...  Add a JavaScript field. In the field definition in the second section is the script editor, where you enter & edit scripts. If the field in Customers is called Warehouse, then the script to enter is merely...
field("Customer").field("Warehouse");  // You can omit the ; if it bothers you
The Customer field above would be the link to Entry field that identifies the Customer.
Every statement in JavaScript is terminated by a semicolon (;), but unless you do something that confuses JavaScript -- like putting multiple statements on a line without using semicolons -- it's not really required, and in this case, it's not needed. We use semicolons in English to separate clauses; we don't do it as much as we used to, though; it's fallen out of fashion. In JavaScript, any text following a // is ignored by JavaScript; that makes it available for use as a comment to the human script reader.

JavaScript fields have an option you might like -- the Hidden option. You can also adjust its visibility based on the current value of a choice field (like an SCL or Radio Buttons field) using Dependencies. These options do not affect the script in any way.

So, save the field by tapping the checkmark. Now, the value of that field in the other library is visible in the current library, though its value can't be changed; it is read-only. And now you can filter by it or use it to group your entries by its value.

Filter tabs...

By the way, some people miss out on some of the power in the entries list by failing to utilize filter tabs. Once you create a filter, you can just use it by selecting the filter or No filter in the filters list. But you can also assign it to a tab to appear at the top of the entries list screen. For example, you could have your top 4 or 5 customers as tabs, filtering maybe on the Name field in Customers. Once you do this, you can switch quickly between them by tapping on a tab. If you want to see for a Customer only the Inventory items in one warehouse, you could tap the tab for that customer and then go back into Filter and select the Warehouse filter. This uses both Customer and Warehouse filters in conjunction with each other. Don't forget to check the All tab so you can switch back to all customers when you want.

I hope this helps. Let me (us) know if you have any questions.

--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/1704dbd3-7cc9-4031-b113-46f8093d5b9dn%40googlegroups.com.

Bill Crews

unread,
Sep 20, 2022, 1:00:23 PM9/20/22
to Fernando Bravo, mementodatabase
Actually, though I've never used the new Lookup field types, I gather that it may do something very similar to the JavaScript fields I suggested to you, so if that's true, it will likely be easier to use than a JavaScript field, especially if you don't already know JavaScript.

Craig Hunter

unread,
Sep 20, 2022, 3:12:28 PM9/20/22
to memento...@googlegroups.com, Bill Crews, Fernando Bravo, mementodatabase
was Re: How to see Attributes easily

Since Bill mentioned it, I experimented with a Lookup field, and it does not seem to work?

The parameters of the field include Library, which has to be a library that is already linked to.  Has anyone found this field to be useful?

-Craig

fernando bravo

unread,
Sep 20, 2022, 3:30:28 PM9/20/22
to Bill Crews, memento...@googlegroups.com
Hi Bill,

Thank you very much.  Great news, it's possible.
I will try the alternatives that you shared with me. I really appreciate your help and time on this.

Regards

Bill Crews

unread,
Sep 20, 2022, 5:11:34 PM9/20/22
to Craig Hunter, mementodatabase, Fernando Bravo
I only know what I see, but I took a library of mine that was a link source and added a Lookup field, and as Craig suggested, the only library out of my 200+ libraries that showed up in the choice list was the library target that library source was linked to.

I see that the fields available to look up are the fields in the library target. I didn't try the Filter option, and I don't know how it's to be used, but from doing what I did, I'm pretty sure I know what the intended audience and the intend use of the field is, and that's to provide a replacement for people who've never programmed of the simplest of JavaScript fields, so they can do simple lookups without having to write even the tiny about of JavaScript I described in that other thread Craig referred to.

So, if a JavaScript field would have had a script...
field("Customer").field("Warehouse")
...then with a Lookup field, you don't have do that. You can avoid that JavaScript by using a Lookup field pointing at the Customers (using the link field Customer) library and specifying the Warehouse field.

I don't see other usefulness to it unless that Filter option does something really useful. Maybe it allows you to do a JavaScript if statement without having to write JavaScript; I don't know.

On rereading my earlier message in that other thread, I realize I didn't suggest to use the two methods together, but that's what I do; it works well and will still work well if you replace the JavaScript field with a Lookup field.

Craig Hunter

unread,
Sep 20, 2022, 7:51:41 PM9/20/22
to Bill Crews, mementodatabase, Fernando Bravo
When editing a record are you able to enter text in the Lookup field and find records in the linked library matching the text? That is what I expect it is supposed to do.

That is not what I get. There is no way to enter text in the Lookup field. Is it a bug?

Beth Dixon

unread,
Sep 20, 2022, 8:10:20 PM9/20/22
to Craig Hunter, Bill Crews, mementodatabase, Fernando Bravo
I have approached support awhile back as I believe there is a bug with the Lookup field in the Desktop version.  It causes Memento to crash.

I received a response from support and they are looking into it.

- Beth

Bill Crews

unread,
Sep 20, 2022, 11:47:08 PM9/20/22
to Beth Dixon, Craig Hunter, mementodatabase, Fernando Bravo
The Lookup field doesn't crash for me on Android.

As I said in my message, I believe it works just like the JavaScript field with the little script I put in that message. That behavior is just as Craig said. The field is read-only and is filled by the script with the value of the target field. That's what happens on my tablet, anyway. If that is the objective, it seems to me there is no bug. The developer is so far silent on all this.

Beth Dixon

unread,
Sep 21, 2022, 9:52:05 AM9/21/22
to Bill Crews, Craig Hunter, mementodatabase, Fernando Bravo
The Lookup field doesn't crash for me on Android either.  Only on Desktop.  I sent support a copy of the error message.  

- Beth
Reply all
Reply to author
Forward
0 new messages