Relationships

Comprehensive databases consist of several Libraries, and it’s a common thing when the entries in different Libraries are connected with each other. The related fields help create logical Library structure and do not duplicate the same entries.

There are three types of relationship that are used in database design: one-to-one, one-to-many and many-to-one. To learn more the difference, visit Linked fields article from Desktop section.

To create the relationship in Memento Database Mobile, click icon at the bottom-right of the window and choose Relationship option or select Link to entry field.

Relationship option allows you to choose the connected Library and set the default parameters, including many-to-many relation type. Anytime later you will be able to re-adjust the linking option. Click burger icon near the created field and choose Change option to set additional parameters: relation type, display options, dependencies, etc. 

This is how the related fields are shown for the end user. The screenshot below shows the Product and all Sales for it:

Mobile: Relationships

Each linked field has additional attributes. Attributes are similar to fields but set more parameters for the linked field. For example, if we link the Products and Sales, we can define how many items of the chosen products were purchased during the single one sale using Integer attribute or the discount the customer got for the sale using Currency attribute. Attributes allow you to set the additional property that hasn’t been defined in any of the linked Libraries. After the attribute is added, the Library end user will need to define attribute value while adding the new entry to this Library.

If you link Libraries, you might find the Lookup field type useful. After adding a Linked field, you can display additional information about the entry from the linked library with this field. Here is what you can customize within the Lookup field type:

  • Set the Field name to define how it shows up in the Library
  • Set Lookup parameters: choose the Library and the Field there to get the information from
  • Set how to Display this field in the Library

For example, you have a library with recipes that you cook, and you wish to display the type of wine that goes well with a certain dish. At the same time, you have a library with various wine types. You would need to add the Link to Entry field in the recipes library to the wine library, then add the Lookup field with Lookup Parameter > Field > Wine type. After that, when you add the wine to your recipe, the type will show up automatically in the recipes library entry.

Was this article helpful?

Related Articles