# Either column required but

**URL:** <https://community.glideapps.com/t/either-column-required-but/37288>\
**Category:** Ask for Help\
**Created:** [January 17, 2022, 3:38am UTC](https://community.glideapps.com/t/either-column-required-but/37288 "2022-01-17T03:38:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [January 17, 2022, 3:38am UTC](https://community.glideapps.com/t/either-column-required-but/37288/1 "2022-01-17T03:38:09Z")

</div>

I have been playing around with this but cannot get it to work. A user suggested that _either_ a field should be keyed in _or_ an image uploaded, but not to require BOTH. My first inclination was to make two edit fields, one visible (and required) if the image is empty, and the other visible (and not required) if there is an image. But Glide didn’t like the conflict that two objects were writing to the same column. Then I tried to make a computed column to test either one containing data, but you cannot make a computed column “required”. I know I can make a custom form and make my own save and cancel buttons, but … is there any simple way around this?

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [January 17, 2022, 3:53am UTC](https://community.glideapps.com/t/either-column-required-but/37288/2 "2022-01-17T03:53:15Z")

</div>

“My first inclination was to make two edit fields, one visible (and required) if the image is empty, and the other visible (and not required) if there is an image. But Glide didn’t like the conflict that two objects were writing to the same column. “

The message you see is just a warning. If I understand you correctly and you only need one or none then that should work.

---

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [January 17, 2022, 3:55am UTC](https://community.glideapps.com/t/either-column-required-but/37288/3 "2022-01-17T03:55:12Z")

</div>

Thanks. Trying it again (never actually saved a record…)

---

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [January 17, 2022, 4:11am UTC](https://community.glideapps.com/t/either-column-required-but/37288/4 "2022-01-17T04:11:07Z")

</div>

That worked for the add screen. On the update screen the visibility flags didn’t work right. I ended up just making the data not required on the modify screen.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [January 17, 2022, 12:08pm UTC](https://community.glideapps.com/t/either-column-required-but/37288/5 "2022-01-17T12:08:34Z")

</div>

You can use external CSS to do that.

```auto
<pre><span><style>

[data-test="nav-button-Done"] {
opacity: 0.4;
pointer-events: none;
}

```

Then make that visible whenever both of your fields are empty. When one of them is filled the CSS will be deactivated.

---

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [January 17, 2022, 12:49pm UTC](https://community.glideapps.com/t/either-column-required-but/37288/6 "2022-01-17T12:49:00Z")

</div>

Excuse my ignorance, but where do I place that code? In an object? In a column? I tried on another post using some CSS, and it just showed in the object like “I’m here! I am CSS!”

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [January 17, 2022, 1:12pm UTC](https://community.glideapps.com/t/either-column-required-but/37288/7 "2022-01-17T13:12:17Z")

</div>

CSS needs be placed in a Rich Text component, and it needs the proper HTML tags included.

`<pre><span><style>`

I like to close those tags afterwards but many people don’t and it still works.

---

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [January 17, 2022, 1:17pm UTC](https://community.glideapps.com/t/either-column-required-but/37288/8 "2022-01-17T13:17:48Z")

</div>

> [@ThinhDinh](#):
>
> Then make that visible whenever both of your fields are empty.

So the user will see the CSS? I’m confused…

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [January 17, 2022, 1:19pm UTC](https://community.glideapps.com/t/either-column-required-but/37288/9 "2022-01-17T13:19:08Z")

</div>

No, they won’t see it. It’s CSS wrapped in html tags, so it doesn’t render as visible text.

Instead you control the visibility of the rich text component.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [January 18, 2022, 7:23pm UTC](https://community.glideapps.com/t/either-column-required-but/37288/11 "2022-01-18T19:23:08Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
