# Can we use stored object id's as a function parameter to access those objects?

**URL:** <https://forums.sui.io/t/can-we-use-stored-object-ids-as-a-function-parameter-to-access-those-objects/45368>\
**Category:** Move\
**Created:** [March 18, 2024, 6:05pm UTC](https://forums.sui.io/t/can-we-use-stored-object-ids-as-a-function-parameter-to-access-those-objects/45368 "2024-03-18T18:05:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![afridi099](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@afridi099](https://forums.sui.io/u/afridi099)\
**Post date:** [March 18, 2024, 6:05pm UTC](https://forums.sui.io/t/can-we-use-stored-object-ids-as-a-function-parameter-to-access-those-objects/45368/1 "2024-03-18T18:05:33Z")

</div>

In my nft contract I have two shared list objects. like →

struct ListA has key{  
id: UID,  
list: Table\<String, bool\>  
}

struct ListB has key{  
id: UID,  
list: Table\<String, bool\>  
}

I have another shared object to store the id’s of listA and listB. like →

struct ListId has key {  
id: UID,  
list\_A: ID,  
list\_B: ID,  
}

now in the mint function I want to access the listA and ListB objects from the stored Id’s and update values of those objects .  
fun mint( list\_id: &mut ListID){  
//Update table of ListA objects using the ListA object Id’s stored in list\_id  
…  
…  
}

Is it possible to do something like this in SUI or what is the correct approach or syntax ?

---

<div class="post-metadata">

**Author:** ![taki](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/taki/32/30736_2.png) [@taki](https://forums.sui.io/u/taki)\
**Post date:** [March 21, 2024, 2:50am UTC](https://forums.sui.io/t/can-we-use-stored-object-ids-as-a-function-parameter-to-access-those-objects/45368/2 "2024-03-21T02:50:10Z")

</div>

Hey @afridi099, direct access to objects by ID is not supported in the current version of the Sui Move.  
After obtaining the ID of the list\_A held in the ListId, pass the ListA object.

```auto
    public fun listA(list_id: &ListId): ID {
        list_id.list_A
    }
    
    public fun mint(listA: &mut ListA, key: String, value: bool) {
        table::add(&mut listA.list, key, value);
    }

```
