# Changing Text Formulas Based on Another Field's Value

**URL:** <https://forums.knack.com/t/changing-text-formulas-based-on-another-fields-value/12907>\
**Category:** Get Answers\
**Created:** [August 14, 2022, 2:02pm UTC](https://forums.knack.com/t/changing-text-formulas-based-on-another-fields-value/12907 "2022-08-14T14:02:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stewart](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@Stewart](https://forums.knack.com/u/Stewart)\
**Post date:** [August 14, 2022, 2:02pm UTC](https://forums.knack.com/t/changing-text-formulas-based-on-another-fields-value/12907/1 "2022-08-14T14:02:50Z")

</div>

Hello Community, reaching out for some help, please.

I have a Short Text field that contains the unique code provided by Youtube to identify videos. Then, I use a Text Formula to render a viewable/playable video. The Text Formula is this:

```auto
<div class="video-responsive"><iframe width="560" height="315" src="https://www.youtube.com/embed/{Short Text Video Code}" title="YouTube video player" allowfullscreen></iframe></div>

```

This works great but I have one problem. If the Short Text field is empty, I’d like to kill the text formula so nothing is rendered and the Text Formula field is blank. I would then use Page Rules to exclude it because it is empty.

A solution seems it would be something like an IF, THEN, ELSE formula but I don’t know how to do this. So IF the Short Text Video Code exists, THEN render the video, Else make it blank/empty.

Hope this makes sense and hope someone can help.

Thank you!

---

<div class="post-metadata">

**Author:** ![Sunny\_Singla](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/sunny_singla/32/1007_2.png) [@Sunny\_Singla](https://forums.knack.com/u/Sunny_Singla)\
**Post date:** [August 15, 2022, 2:51pm UTC](https://forums.knack.com/t/changing-text-formulas-based-on-another-fields-value/12907/2 "2022-08-15T14:51:57Z")

</div>

Hello Stewart,

User one more text field. And add condition if “Short Text Video Code” is blank then make this field blank otherwise fill with **text formula field value**.

Regards,  
Sunny Singla  
[ssingla1985@gmail.com](mailto:ssingla1985@gmail.com)

---

<div class="post-metadata">

**Author:** ![Stewart](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@Stewart](https://forums.knack.com/u/Stewart)\
**Post date:** [August 15, 2022, 3:36pm UTC](https://forums.knack.com/t/changing-text-formulas-based-on-another-fields-value/12907/3 "2022-08-15T15:36:43Z")

</div>

Thank you Sunny, that sounds very promising. Can you please show me the proper syntax for that as an example? THANK YOU!!

---

<div class="post-metadata">

**Author:** ![Sunny\_Singla](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/sunny_singla/32/1007_2.png) [@Sunny\_Singla](https://forums.knack.com/u/Sunny_Singla)\
**Post date:** [August 15, 2022, 5:52pm UTC](https://forums.knack.com/t/changing-text-formulas-based-on-another-fields-value/12907/4 "2022-08-15T17:52:09Z")

</div>

Sure

 ![image](https://us1.discourse-cdn.com/flex020/uploads/knack/original/2X/4/47a6f4cc2ca3a196a78785bffedbb5c5d6d24ffe.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/knack/original/2X/5/58132bcb1d890a7d7e401fe1344faa9ce0a709c7.png)  
add rules in this new text field  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/knack/original/2X/d/da40d7967c7fce90bc4fb45529cdac07e68b6bce.png)

Thanks

---

<div class="post-metadata">

**Author:** ![Sunny\_Singla](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/sunny_singla/32/1007_2.png) [@Sunny\_Singla](https://forums.knack.com/u/Sunny_Singla)\
**Post date:** [August 15, 2022, 5:52pm UTC](https://forums.knack.com/t/changing-text-formulas-based-on-another-fields-value/12907/5 "2022-08-15T17:52:40Z")

</div>

And use this new field to display video

---

<div class="post-metadata">

**Author:** ![Stewart](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@Stewart](https://forums.knack.com/u/Stewart)\
**Post date:** [August 15, 2022, 6:40pm UTC](https://forums.knack.com/t/changing-text-formulas-based-on-another-fields-value/12907/6 "2022-08-15T18:40:19Z")

</div>

Thank you so much Sunny. I will definitely try this out. Have a great day!
