# 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:** 20\
**Page:** 1

<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, 11:45am UTC](https://community.glideapps.com/t/if-else-openai-column/63522/1 "2023-07-05T11:45:23Z")

</div>

Hey guys,

Is it possible to only run computed columns based on an if else statement.

I only want to run a voice to text & summarise column if a certain option is selected

Example : If “teacher” is selected , run the “teacher summary” column but not the default summarise column

In the screenshot below , you can see interview is selected by the user but the teacher columns still run

 ![Screenshot 2023-07-05 at 12.42.15](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/c/bcc5cd2df9d3d9f6ad5330943ae9c23a36e52f2f.png)  
t

---

<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:** [July 5, 2023, 11:49am UTC](https://community.glideapps.com/t/if-else-openai-column/63522/2 "2023-07-05T11:49:24Z")

</div>

You could make the result of an IF column be the source value used in your ai column. If the IF column returns a blank, then I assume the AI column wouldn’t do anything because you would be feeding it a blank.

---

<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, 2:08pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/3 "2023-07-05T14:08:17Z")

</div>

Sorry , my brain is not firing on all cylinders today…how would an example of that look like using the columns I have in the screenshot

---

<div class="post-metadata">

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

</div>

Assuming that the Teacher columns refer to the URL column, then something like this:

- If Summary Style is Teacher, then URL column

And then point those last two columns at the if-then-else column instead of the URL column.

---

<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, 2:26pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/5 "2023-07-05T14:26:47Z")

</div>

Currently I have Summary Teacher | Message - UL\_Speech\_To\_Text | & Summary\_Work | Message - Summary-Teacher |

Both OpenAI - Send chat to GPT without history

---

<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, 2:33pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/6 "2023-07-05T14:33:29Z")

</div>

Summary Style is a choice component column

---

<div class="post-metadata">

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

</div>

So did I get it wrong?

---

<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, 2:42pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/8 "2023-07-05T14:42:17Z")

</div>

This just populates the link to recording in the IF column

---

<div class="post-metadata">

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

</div>

Yes, that’s the idea. But only when the correct condition is met. If not, it will return nothing, and so the AI column/s won’t do anything.

---

<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, 2:54pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/10 "2023-07-05T14:54:27Z")

</div>

So it populates the summary columns first now instead but then UL columns follow , rather than the other way around

---

<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:03pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/11 "2023-07-05T15:03:34Z")

</div>

All 4 still populate

---

<div class="post-metadata">

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

</div>

yeah, I don’t really understand what each of your columns does - I’m just guessing from what you’ve shown.

But do you understand the concept?  
That is - the if-then-else column serves as a _replacement_ for the URL column.

How many different values can you have in the Summary Style column?  
Two?  
You might need two if-then-else columns - one to cover each case.

Sorry, but I’m guessing here. It would be really helpful if you could explain what each of those columns shown in your screen shot does, and which ones refer to which other ones.

---

<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:08pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/13 "2023-07-05T15:08:57Z")

</div>

- UL\_Link to Recording = URL for audio recorder
- UL SpeechToText = convert from URL
- UL Summary = summarise UL\_SpeechToText

Summary Style = Choice component

- Summary\_Teacher = Summarise UL\_SpeechToText (ChatGPT no history)
- Summary\_Work = Summarise Summary\_Teacher (ChatGPT no history)

---

<div class="post-metadata">

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

</div>

Great!  
That really really helps.

Okay, so… tell me if this is correct:

- The UL Summary column should always run, no matter what the Summary Style column value is
- The Summary\_Teacher column should only run if the Summary Style is “teacher”
- The Summary\_Work column should only run if the Summary Style is “interview”

Is that correct?

---

<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:16pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/15 "2023-07-05T15:16:58Z")

</div>

UL\_SpeechToText should always run as this is the start point from the audio recording

If Summary Style is Teacher then Summary\_Teacher & Summary\_Work should run but not UL\_Summary as its not needed.

Interview would be another choice than teacher , so would need another IF column as you said before.

I just don’t want to have to run the OpenAI call for every column every time , but rather the matching Style column ie Teacher style only runs Summary\_Teacher & Summary\_Teacher\_Work

---

<div class="post-metadata">

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

</div>

> [@Emmett\_M](#):
>
> I just don’t want to have to run the OpenAI call for every column every time , but rather the matching Style column ie Teacher style only runs Summary\_Teacher & Summary\_Teacher\_Work

yep, understood.

Just one more question, sorry:

> [@Emmett\_M](#):
>
> If Summary Style is Teacher then Summary\_Teacher & Summary\_Work should run but not UL\_Summary as its not needed.

What about if Summary Style is Interview, should all 3 columns run, or…?

---

<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:34pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/17 "2023-07-05T15:34:14Z")

</div>

Then it would run 2 other additonal columns instead that would have a different summary style

User records/uploads audio , converted to speech to text , text is used to create a different summary based on their profile chosen ie Interview , Teacher etc

In its current state , every column would create a summary no matter what summary style is chosen , which is not ideal for my OpenAI API charges 😃

---

<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 5, 2023, 3:42pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/18 "2023-07-05T15:42:10Z")

</div>

Hi!  
Why you need 2 ai column instead to change AI column parameters by if then else column according style?

---

<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:43pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/19 "2023-07-05T15:43:08Z")

</div>

Each AI column has a different prompt

---

<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 5, 2023, 3:45pm UTC](https://community.glideapps.com/t/if-else-openai-column/63522/20 "2023-07-05T15:45:18Z")

</div>

ok, but nether else you can to bypass (by if )ai parameters to force stop ai works

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