# Complex Logic for Custom Module Fields Visibility

**URL:** <https://community.hubspot.com/t/complex-logic-for-custom-module-fields-visibility/64346>\
**Category:** HubSpot Ideas\
**Tags:** design-manager\
**Created:** [September 2, 2022, 10:24am UTC](https://community.hubspot.com/t/complex-logic-for-custom-module-fields-visibility/64346 "2022-09-02T10:24:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arinker](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/arinker/32/14511_2.png) [@arinker](https://community.hubspot.com/u/arinker)\
**Post date:** [September 2, 2022, 10:24am UTC](https://community.hubspot.com/t/complex-logic-for-custom-module-fields-visibility/64346/1 "2022-09-02T10:24:18Z")

</div>

At the moment the visibility of a field can only be controlled depending on another field property. For an optimal user experience it would often be useful to control the visibility of a field based on several conditions that can be logically linked with “AND”, “OR” “NOT\_AND” and “NOT\_OR”.

Additionally, nesting this logic would certainly be helpful in some cases. The principle can be found among other things in the filtering of smart lists.

**Example:**

```lia-code-sample
"visibility": [
 "logic": "AND",
 "conditions": [
 [
 "controlling_field": "cards.type",
 "controlling_value_regex": "product",
 "operator": "EQUAL"
 ],
 [
 "controlling_field": "cards.darkmode",
 "controlling_value_regex": "true",
 "operator": "EQUAL"
 ]
 ]
]

```

---

<div class="post-metadata">

**Author:** ![arinker](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/arinker/32/14511_2.png) [@arinker](https://community.hubspot.com/u/arinker)\
**Post date:** [November 22, 2022, 9:14am UTC](https://community.hubspot.com/t/complex-logic-for-custom-module-fields-visibility/64346/2 "2022-11-22T09:14:31Z")

</div>

# **SOLVED**

See

`advanced_visibility​`

under [Module and Theme Fields Overview - HubSpot docs](https://developers.hubspot.com/docs/cms/building-blocks/module-theme-fields-overview#field-visibility)
