# One-to-One Relationship?

**URL:** <https://forum.adalo.com/t/one-to-one-relationship/26380>\
**Category:** Get Help\
**Created:** [April 23, 2022, 11:01am UTC](https://forum.adalo.com/t/one-to-one-relationship/26380 "2022-04-23T11:01:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![QIRO](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/qiro/32/19078_2.png) [@QIRO](https://forum.adalo.com/u/QIRO)\
**Post date:** [April 23, 2022, 11:01am UTC](https://forum.adalo.com/t/one-to-one-relationship/26380/1 "2022-04-23T11:01:44Z")

</div>

I am trying to create a relationship between two databases that allow assets to be signed out like so:

Assets: RED BLUE GREEN

People: TOM SAM SARAH

Any asset can be signed to any person, but only once. I have managed to get the one-to-many working, but I can sign the same asset to TOM, SAM and SARAH at the same time. Once it is signed back in, it can be allocated to another person.

How would I go about setting up so once it’s assigned to someone, it disappears from the available list? Then reappears once it is returned?

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [April 23, 2022, 11:58am UTC](https://forum.adalo.com/t/one-to-one-relationship/26380/2 "2022-04-23T11:58:54Z")

</div>

Hi David,

You can use a Many to Many relationship for this instead of One to Many or you can use Joint Tables!

With Many to Many relationship :

> **[Assets with Many to Many.mp4](https://drive.google.com/file/d/1GutYc0IffUr9ooW4gobEwkv9KLW11eWt/view?usp=sharing)**
>
> Google Drive file.

With Joint Tables:

> **[Assets with Joint Tables.mp4](https://drive.google.com/file/d/1hA16pmqUySkYz5MPd1k4Afs1pfSrtfiq/view?usp=sharing)**
>
> Google Drive file.

Thank you

---

<div class="post-metadata">

**Author:** ![QIRO](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/qiro/32/19078_2.png) [@QIRO](https://forum.adalo.com/u/QIRO)\
**Post date:** [April 23, 2022, 7:53pm UTC](https://forum.adalo.com/t/one-to-one-relationship/26380/3 "2022-04-23T19:53:05Z")

</div>

Hi Dilon,

That’s an amazing level of support, thank you!

In my current setup, I am working with people in a database, not logged-in users.

I have a list that displays people, you select one and it allows you to assign an asset to that individual, by adding the asset to the main database in an appropriate column, like this:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/e/f/efd7ed9ba87d5b9a369e66c2fee10abc1c5dedf9.png)

What I would like to achieve, is the dropdown list does not display any asset that is already assigned to someone else. Is that possible the same way?

Sorry if I’m making daft statements, I’m brand new here from AppSheet so I’m relearning how to work.

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [April 24, 2022, 5:13am UTC](https://forum.adalo.com/t/one-to-one-relationship/26380/4 "2022-04-24T05:13:48Z")

</div>

> [@QIRO](#):
>
> That’s an amazing level of support, thank you!

Your Welcome!

> [@QIRO](#):
>
> What I would like to achieve, is the dropdown list does not display any asset that is already assigned to someone else. Is that possible the same way?

It means that a Asset can have only one user. Correct?

> **[Assign Users for Assets.mp4](https://drive.google.com/file/d/1QtzuZeQnfAj3PPHLtbxJN-UXU4tDaFsO/view?usp=sharing)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![QIRO](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/qiro/32/19078_2.png) [@QIRO](https://forum.adalo.com/u/QIRO)\
**Post date:** [April 24, 2022, 8:34am UTC](https://forum.adalo.com/t/one-to-one-relationship/26380/5 "2022-04-24T08:34:51Z")

</div>

Hi Dilon,

This is it! Great work, thank you.

Just so I understand the logic, are we telling the function to only display the devices with no users attached?

Strangely, my dropdown doesn’t display the currently assigned asset as yours does, other than that, working as intended - thanks again.

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [April 24, 2022, 8:59am UTC](https://forum.adalo.com/t/one-to-one-relationship/26380/6 "2022-04-24T08:59:44Z")

</div>

> [@QIRO](#):
>
> This is it! Great work, thank you.

Your Welcome!

> [@QIRO](#):
>
> are we telling the function to only display the devices with no users attached?

Yes. You want the user to have many assets and a asset can have one user or a user can have one asset and asset can have many users?

> [@QIRO](#):
>
> Strangely, my dropdown doesn’t display the currently assigned asset as yours does

To show that you need to add a OR filter like this.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/5/0/50b755f4f4928425e8547e4bcc6aaafdd05713d1.png)

---

<div class="post-metadata">

**Author:** ![QIRO](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/qiro/32/19078_2.png) [@QIRO](https://forum.adalo.com/u/QIRO)\
**Post date:** [April 24, 2022, 9:08am UTC](https://forum.adalo.com/t/one-to-one-relationship/26380/7 "2022-04-24T09:08:01Z")

</div>

Yep, you were absolutely right.

I don’t really understand a lot of the logic in Adalo yet, I’m used to writing expressions that are mathematically logical, so this is different for me.

Thanks for all your help =)

My next task is to get the assets returned at the end of the day, I’m halfway there, they can be removed with a single button, but they never reappeat in the list. I’m getting something wrong with the relationships I think, as they appear as ‘Untitled’ in the database if you use the delete function.

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [April 24, 2022, 9:12am UTC](https://forum.adalo.com/t/one-to-one-relationship/26380/8 "2022-04-24T09:12:31Z")

</div>

> [@QIRO](#):
>
> as they appear as ‘Untitled’ in the database if you use the delete function.

In that collection does the first property is empty? Then you will get that Untitled in the Database!

See this post by Mario:

> [@Possible Bug? - Linking databases - Dropdown content not visible](https://forum.adalo.com/t/possible-bug-linking-databases-dropdown-content-not-visible/25306/2):
>
> Hey there @jordan Your “search input” is the first field. That’s the field that displays on the dropdown in other collections. You can rearrange the parameters on the collection so that a different one is in the first position. Since all of your records’ “Search input” parameters are blank, that’s why you’re seeing the blank options for the dropdown. So simply move that one down below the tmdb\_id parameter on the collections and you’ll see the tmdb\_id in the dropdown. Or set whichever one yo…

---

<div class="post-metadata">

**Author:** ![QIRO](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/qiro/32/19078_2.png) [@QIRO](https://forum.adalo.com/u/QIRO)\
**Post date:** [April 24, 2022, 9:25am UTC](https://forum.adalo.com/t/one-to-one-relationship/26380/9 "2022-04-24T09:25:25Z")

</div>

The issue appears to have been that using a Delete function on a Users Asset will delete the entire asset. It was appearing as Untitled because the database had no idea where the asset went.

Refreshing the page revealed the problem.

Is there a better way to clear the asset from a user with a single button press, instead of going through every dropdown and setting it back to ‘Select asset’?

---

<div class="post-metadata">

**Author:** ![Rozza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/rozza/32/22780_2.png) [@Rozza](https://forum.adalo.com/u/Rozza)\
**Post date:** [April 24, 2022, 10:19am UTC](https://forum.adalo.com/t/one-to-one-relationship/26380/10 "2022-04-24T10:19:40Z")

</div>

Adalo documentation says that for 1:1 you just disregard the ‘many’ side of the relationship and consider to be ‘1’. In reality I don’t think it works as one would expect.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/system/32/40401_2.png) [@system](https://forum.adalo.com/u/system)\
**Post date:** [May 4, 2022, 10:19am UTC](https://forum.adalo.com/t/one-to-one-relationship/26380/11 "2022-05-04T10:19:46Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
