# Access Object property in a package entry function with Object ID parameter

**URL:** <https://forums.sui.io/t/access-object-property-in-a-package-entry-function-with-object-id-parameter/45378>\
**Category:** Technical Support\
**Tags:** move\
**Created:** [March 19, 2024, 11:06am UTC](https://forums.sui.io/t/access-object-property-in-a-package-entry-function-with-object-id-parameter/45378 "2024-03-19T11:06:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tahlil](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/tahlil/32/30688_2.png) [@tahlil](https://forums.sui.io/u/tahlil)\
**Post date:** [March 19, 2024, 11:06am UTC](https://forums.sui.io/t/access-object-property-in-a-package-entry-function-with-object-id-parameter/45378/1 "2024-03-19T11:06:52Z")

</div>

Consider the following code:

```auto
module experiment::test {
    struct TableA has key{
        id: UID,
        list: Table<String, bool>
    }

    fun init(otw: TEST, ctx: &mut TxContext) { 
       // Create TableA type Object
    }

     public entry fun add_element(
        object_id: UID,
        element_to_add: String
    ){
        // Add element to the object with the ID, object_id
    }

```

In the `add_element` function how can I access the TableA type Object and add the string element `element_to_add`?

---

<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, 3:35am UTC](https://forums.sui.io/t/access-object-property-in-a-package-entry-function-with-object-id-parameter/45378/2 "2024-03-21T03:35:23Z")

</div>

@tahlil Set the argument to `TableA` object, not a `UID`.

```auto
    public entry fun add_elements(tableA: &mut TableA, key: String, value: bool) {
        table::add(&mut tableA.list, key, value);
    }

```
