# Functions - two levels deep

**URL:** <https://community.appfarm.io/t/functions-two-levels-deep/770>\
**Category:** Ask the community\
**Created:** [October 16, 2023, 2:15pm UTC](https://community.appfarm.io/t/functions-two-levels-deep/770 "2023-10-16T14:15:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Siri](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/siri/32/1368_2.png) [@Siri](https://community.appfarm.io/u/Siri)\
**Post date:** [October 16, 2023, 2:15pm UTC](https://community.appfarm.io/t/functions-two-levels-deep/770/1 "2023-10-16T14:15:24Z")

</div>

In the documentation for functions it is written that you cannot refer to properties more than one level deep when adding whole data sources as function parameters.

It says that you need to add a runtime property (function) to the `Contacts` data source (for example `companyName` , returning `Contacts.Company.Name` ) and refer to this property as `Contacts[0].companyName` .

How do I write a function that returnes Contacts.Company.Name in the runtime property? (Isn’t that what was impossible?)

---

<div class="post-metadata">

**Author:** ![rhys](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/rhys/32/1379_2.png) [@rhys](https://community.appfarm.io/u/rhys)\
**Post date:** [October 16, 2023, 2:38pm UTC](https://community.appfarm.io/t/functions-two-levels-deep/770/2 "2023-10-16T14:38:45Z")

</div>

Hi Siri

Thank you for your question.

When writing this runtime property on the Contacts object, it is only one level deep (referring to Company-\>Name) so it is possible.

Please consider my example below:

You have a list of Projects. Each project is associated with a Contact, and each Contact is associated with a Company. From a Project, it is not possible to access the Company Name as it is too many levels deep. (Project-\>Contact-\>Company-\>Name).

Adding a runtime property to the Contact object can refer to `Contact.Company.Name`, which is only one level deep. Once this runtime property is created, it is perfectly in the middle of Project and Company and therefore can act as the bridge between them.

The first screenshot below is the runtime property on the Contacts object, and the second screenshot is an example of how this can be used in a runtime property on the Project object.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/53056f3823eede16f9fb6ad75ce3cf0a35f73a11.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/d38ec481acfa47d10a393b91d8027ace6cd829a4.png)

I hope this helps.

Rhys

---

<div class="post-metadata">

**Author:** ![Siri](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/siri/32/1368_2.png) [@Siri](https://community.appfarm.io/u/Siri)\
**Post date:** [October 16, 2023, 2:48pm UTC](https://community.appfarm.io/t/functions-two-levels-deep/770/3 "2023-10-16T14:48:31Z")

</div>

Perfect, thank you for the fast reply and clarifying answer. 🙂
