# Apply Display Rules to Fields from a Connected Object

**URL:** <https://forums.knack.com/t/apply-display-rules-to-fields-from-a-connected-object/7821>\
**Category:** Ask Developers\
**Created:** [September 25, 2015, 8:08pm UTC](https://forums.knack.com/t/apply-display-rules-to-fields-from-a-connected-object/7821 "2015-09-25T20:08:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SheilaSata78024](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@SheilaSata78024](https://forums.knack.com/u/SheilaSata78024)\
**Post date:** [September 25, 2015, 8:08pm UTC](https://forums.knack.com/t/apply-display-rules-to-fields-from-a-connected-object/7821/1 "2015-09-25T20:08:57Z")

</div>

I have a company object and department object. These are linked in a one-to-many relationship. I have a display view for each department that also shows company information. I want to use Display Rules to control which fields are shown. Some departments may have their own contact information (phone number, email, etc.), some may just have the company contact info. I want to show the department specific info if it's available and hide the field if it's not. I'm able to do that. But I also want to hide the company contact info if the department info is available. Though I can add fields from the company object to the department display view, I cannot select fields from the company object in the display rules. Is there any other way of accomplishing this?

---

<div class="post-metadata">

**Author:** ![MarkEdward68051](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/markedward68051/32/228_2.png) [@MarkEdward68051](https://forums.knack.com/u/MarkEdward68051)\
**Post date:** [January 20, 2019, 9:34am UTC](https://forums.knack.com/t/apply-display-rules-to-fields-from-a-connected-object/7821/2 "2019-01-20T09:34:13Z")

</div>

Any chance you can elaborate how you solved this? I have a similar issue - I have a Hospital User with an address field and I would like the Shift object to auomatically populate with the hospital address whenever a new shift is created. Is that possible?

---

<div class="post-metadata">

**Author:** ![JeremyNels15348](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/jeremynels15348/32/156_2.png) [@JeremyNels15348](https://forums.knack.com/u/JeremyNels15348)\
**Post date:** [June 9, 2016, 7:51pm UTC](https://forums.knack.com/t/apply-display-rules-to-fields-from-a-connected-object/7821/3 "2016-06-09T19:51:35Z")

</div>

I've had to do plenty of those text equation fields to accomplish stuff like this, but if you can display a value in the table, you ought to be able to set display rules based on that information.

---

<div class="post-metadata">

**Author:** ![SheilaSata78024](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@SheilaSata78024](https://forums.knack.com/u/SheilaSata78024)\
**Post date:** [October 22, 2015, 8:01pm UTC](https://forums.knack.com/t/apply-display-rules-to-fields-from-a-connected-object/7821/4 "2015-10-22T20:01:40Z")

</div>

I figured it out. Instead of trying to add the company fields to the department display, I used Text Combo fields to add the fields directly to the department object. Yay.

---

<div class="post-metadata">

**Author:** ![SheilaSata78024](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@SheilaSata78024](https://forums.knack.com/u/SheilaSata78024)\
**Post date:** [October 5, 2015, 5:31pm UTC](https://forums.knack.com/t/apply-display-rules-to-fields-from-a-connected-object/7821/5 "2015-10-05T17:31:00Z")

</div>

Unfortunately, I am not at all comfortable using Javascript. I'm just amazed I've managed to do as much as I have considering I have no idea what I'm doing. I can just work with what I have. Thanks.

---

<div class="post-metadata">

**Author:** ![BradStevens](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/bradstevens/32/140_2.png) [@BradStevens](https://forums.knack.com/u/BradStevens)\
**Post date:** [September 25, 2015, 8:16pm UTC](https://forums.knack.com/t/apply-display-rules-to-fields-from-a-connected-object/7821/6 "2015-09-25T20:16:36Z")

</div>

You can using Javascript - check out Steven's example here [http://helpdesk.knackhq.com/support/discussions/topics/5000060557](http://helpdesk.knackhq.com/support/discussions/topics/5000060557)
