# If Else - OpenAI column

**URL:** <https://community.glideapps.com/t/if-else-openai-column/63522>\
**Category:** Ask for Help\
**Created:** [July 5, 2023, 11:45am UTC](https://community.glideapps.com/t/if-else-openai-column/63522 "2023-07-05T11:45:23Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/96552_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [July 5, 2023, 3:48pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/21 "2023-07-05T15:48:03Z")

</div>

Okay, I think we are just about there 🙂

- Create two if-then-else columns:  
– Call the first one something like ifTeacher  
— If Summary Style is Teacher, then UL\_SpeechToText  
– Call the second one ifInterview  
— If Summary Style is Interview, then UL\_SpeechToText

Now for each of your AI columns, configure as follows:

- If the column should _only_ run when the Summary Style is Teacher, configure it to use the ifTeacher column
- If the column should _only_ run when the Summary Style is Interview, configure it to use the ifInterview column
- If the column should _always_ run, configure it to use the UL\_SpeechToText column.

That should do it, I think.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/96552_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [July 5, 2023, 3:55pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/22 "2023-07-05T15:55:00Z")

</div>

> [@slscustom.ru](#):
>
> Why you need 2 ai column instead to change AI column parameters by if then else column according style?

That’s probably what I would do - it would mean less columns overall 🙂

---

<div class="post-metadata">

**Author:** ![Emmett\_M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/emmett_m/32/60683_2.png) [@Emmett\_M](https://community.glideapps.com/u/Emmett_M)\
**Post date:** [July 5, 2023, 3:58pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/23 "2023-07-05T15:58:40Z")

</div>

And IT WORKS , that seems so obvious and simple but you sir , deserve an applause…Thank you!

Not sure what you guys mean about the IF else AI column but feel like I dont want to break anything after just getting this working ha!

Feel free to elaborate though , I might give it a try tomorrow

---

<div class="post-metadata">

**Author:** ![Emmett\_M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/emmett_m/32/60683_2.png) [@Emmett\_M](https://community.glideapps.com/u/Emmett_M)\
**Post date:** [July 5, 2023, 4:00pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/24 "2023-07-05T16:00:13Z")

</div>

A nested if else statement rather than multiple IF columns?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/96552_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [July 5, 2023, 4:01pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/25 "2023-07-05T16:01:52Z")

</div>

> [@Emmett\_M](#):
>
> And IT WORKS , that seems so obvious and simple but you sir , deserve an applause…Thank you!

Great! Took us a little while to get there, but we did in the end 👍

> [@Emmett\_M](#):
>
> Not sure what you guys mean about the IF else AI column but feel like I dont want to break anything after just getting this working ha!

Essentially what @slscustom.ru was getting at there (I believe) is that you could have the if-then-else column output the correct AI prompt based on the selected Summary Style, and then reduce the total number of AI columns required.

---

<div class="post-metadata">

**Author:** ![Emmett\_M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/emmett_m/32/60683_2.png) [@Emmett\_M](https://community.glideapps.com/u/Emmett_M)\
**Post date:** [July 5, 2023, 4:05pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/26 "2023-07-05T16:05:54Z")

</div>

Ah I see , mission accomplished for today anyhow…I’m sure ill be back at some stage with more questions 😃

Thanks again , very much appreciated.

Good work

---

<div class="post-metadata">

**Author:** ![david](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david/32/62831_2.png) [@david](https://community.glideapps.com/u/david)\
**Post date:** [July 6, 2023, 2:59am UTC](https://community.glideapps.com/t/if-else-openai-column/63522/27 "2023-07-06T02:59:30Z")

</div>

Glide only calculates what it needs to show your screen, EXCEPT when you’re looking at the data editor—then it calculates everything. If you don’t display the results of using OpenAI, they won’t get generated in the app. If the If-Else doesn’t choose the unused prompt completion, it doesn’t get called.

---

<div class="post-metadata">

**Author:** ![Emmett\_M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/emmett_m/32/60683_2.png) [@Emmett\_M](https://community.glideapps.com/u/Emmett_M)\
**Post date:** [July 6, 2023, 8:09am UTC](https://community.glideapps.com/t/if-else-openai-column/63522/28 "2023-07-06T08:09:10Z")

</div>

So if I use the visibility function for the frontend to only show a certain column from a row , they will be the only ones that run on the data sheet? Effectively not needing the IF-Else columns then?

---

<div class="post-metadata">

**Author:** ![slscustom.ru](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/slscustom.ru/32/77336_2.png) [@slscustom.ru](https://community.glideapps.com/u/slscustom.ru)\
**Post date:** [July 6, 2023, 10:26am UTC](https://community.glideapps.com/t/if-else-openai-column/63522/29 "2023-07-06T10:26:40Z")

</div>

> [@david](#):
>
> Glide only calculates what it needs to show your screen, EXCEPT when you’re looking at the data editor—then it calculates everything. If you don’t display the results of using OpenAI, they won’t get generated in the app. If the If-Else doesn’t choose the unused prompt completion, it doesn’t get called.

Very, very inportant and usefull comment! Thanks David!!!

---

<div class="post-metadata">

**Author:** ![david](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david/32/62831_2.png) [@david](https://community.glideapps.com/u/david)\
**Post date:** [July 6, 2023, 8:31pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/30 "2023-07-06T20:31:51Z")

</div>

> [@Emmett\_M](#):
>
> So if I use the visibility function for the frontend to only show a certain column from a row , they will be the only ones that run on the data sheet? Effectively not needing the IF-Else columns then?

Yes.

[Previous page](https://community.glideapps.com/t/if-else-openai-column/63522.md?page=1)
