# Question About setFieldShown

**URL:** <https://forum.kintone.dev/t/question-about-setfieldshown/165>\
**Category:** General\
**Created:** [September 4, 2018, 4:56am UTC](https://forum.kintone.dev/t/question-about-setfieldshown/165 "2018-09-04T04:56:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [September 4, 2018, 4:56am UTC](https://forum.kintone.dev/t/question-about-setfieldshown/165/1 "2018-09-04T04:56:22Z")

</div>

Dear Developers

It’s on Detail, after you click on a detail of record on index

I was able to hide a Field simply by typing

kintone.app.record.setFieldShown(“field\_name”, false);

However, after I set two field into a table, I’m able to hide the table but can’t hide the field (row)

Let’s say: table=table\_ab, field 1=A, field 2=B

I’m able to hide the table\_ab, but cant hide A using kintone.app.record.setFieldShown(“A”, false);

Please help, any answer would be appreciated, thank you

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [September 4, 2018, 3:14pm UTC](https://forum.kintone.dev/t/question-about-setfieldshown/165/2 "2018-09-04T15:14:21Z")

</div>

Hello Afief,  
This can be done by using the JS and the CSS. The scripts are something like the following:

Javascript

```
(function() {
"use strict";
kintone.events.on(["app.record.detail.show"], function(event) {
document.getElementById('record-gaia').classList.add('xxx-show');
return event;
});
})();

```

CSS:

```
.xxx-show .subtable-gaia th:nth-child(2),
.xxx-show .subtable-gaia td:nth-child(2) {
display: none;
}

```

The above sample scripts will hide the 2nd field in a table upon displaying the record detail.  
If you want to hide the 3rd field in a table,&nbsp;change the “nth-child(2)” to “nth-child(3)” in the CSS script.  
Also FYI, you need to create separate files for the Javascript and the CSS.

And lastly, these scripts&nbsp;are utilizing the DOM&nbsp;so&nbsp;it may not work one day after any kintone update when the DOM structure changes.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [September 4, 2018, 11:39pm UTC](https://forum.kintone.dev/t/question-about-setfieldshown/165/3 "2018-09-04T23:39:40Z")

</div>

Just to note,&nbsp;_**kintone.app.record.setFieldShown()**_&nbsp;cannot be used against&nbsp;fields inside tables

![](https://developer.kintone.io/hc/user_images/wiroG2r1kTw8NWZwD8gkxQ.png)

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [September 14, 2018, 10:17am UTC](https://forum.kintone.dev/t/question-about-setfieldshown/165/4 "2018-09-14T10:17:27Z")

</div>

Hello Yuzo and William

The problem has been fixed, I found the solution based on what you posted here, thank you very much, I appreciate it
