# If- then - else in data editor

**URL:** <https://community.glideapps.com/t/if-then-else-in-data-editor/36269>\
**Category:** Ask for Help\
**Created:** [December 23, 2021, 6:35am UTC](https://community.glideapps.com/t/if-then-else-in-data-editor/36269 "2021-12-23T06:35:54Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [December 23, 2021, 3:53pm UTC](https://community.glideapps.com/t/if-then-else-in-data-editor/36269/6 "2021-12-23T15:53:49Z")

</div>

Hola!

If I were you, I’d use a combination of JS code with RegEx syntax to save columns and time. All in one column.

Something like it here:

> [@RegEx challenge (or just seems that way)](https://community.glideapps.com/t/regex-challenge-or-just-seems-that-way/36138/9):
>
> Hi again @Darren_Murphy and @Test_Test I get this using the JavaScript plugin, In my case, I only want phones with the format: XXXX-YYYYYYY (4 numbers \<5 + “-” + 7 numbers) const r = /([0-4]{4})-([0-9]{7}$)/; return r.test(p1) I hope it helps! Saludos.

Saludos!

---

_[View the full topic](https://community.glideapps.com/t/if-then-else-in-data-editor/36269)._
