# Check for value in another view on page

**URL:** <https://forums.knack.com/t/check-for-value-in-another-view-on-page/7837>\
**Category:** Ask Developers\
**Created:** [August 21, 2015, 6:37pm UTC](https://forums.knack.com/t/check-for-value-in-another-view-on-page/7837 "2015-08-21T18:37:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MoeLevine91222](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@MoeLevine91222](https://forums.knack.com/u/MoeLevine91222)\
**Post date:** [August 21, 2015, 6:37pm UTC](https://forums.knack.com/t/check-for-value-in-another-view-on-page/7837/1 "2015-08-21T18:37:41Z")

</div>

Is there any way of to hide a view based on the value from another view on that same page?

For example: I have a view (#view\_223) which has field\_530 with a span value of "Yes". I want to show another view (#view\_224) only if this field is set to "Yes". If its empty or "No" it should hide (#view\_224).

The 2 views are coming from different database objects (in case that matters).

Is this possible? Any ideas how I can go about doing this?

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:** [January 2, 2016, 10:04pm UTC](https://forums.knack.com/t/check-for-value-in-another-view-on-page/7837/2 "2016-01-02T22:04:53Z")

</div>

We do this a lot and the trick is to use Knack.models in the Javascript window - first seen in this post here and it's worth studying the code for other ideas: [http://www.knackhq.com/links/blogs/dynamic-pdfs-and-documents-with-webmerge.html](http://www.knackhq.com/links/blogs/dynamic-pdfs-and-documents-with-webmerge.html)

Here's a snippet from an app of ours - alter the views and fields for yours:

```
var data_view_392 = Knack.models['view_392'].toJSON();
    var field_555 = data_view_392.field_555

```
if (field_555 == 'Yes') {
	$("#view_771").remove();
} else {
    $("#view_1030").remove();
}</pre><p>Both view_392 and field_555 in this example must be on screen to work, and you can use this approach inside a screen or view render handler.</p>
```
```

---

<div class="post-metadata">

**Author:** ![BennetSt.L83204](https://avatars.discourse-cdn.com/v4/letter/b/848f3c/32.png) [@BennetSt.L83204](https://forums.knack.com/u/BennetSt.L83204)\
**Post date:** [January 2, 2016, 7:15pm UTC](https://forums.knack.com/t/check-for-value-in-another-view-on-page/7837/3 "2016-01-02T19:15:13Z")

</div>

I have snippet of code that does something similiar that I could modify for this situation.

Question though - is the yes/no field we're talking about, is that a field the user is selecting, or detail of exisiting record?
