# Calling Actions for an AI Component

**URL:** <https://community.glideapps.com/t/calling-actions-for-an-ai-component/79815>\
**Category:** Community Resources\
**Tags:** ai, actions\
**Created:** [February 5, 2025, 5:51pm UTC](https://community.glideapps.com/t/calling-actions-for-an-ai-component/79815 "2025-02-05T17:51:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattLB](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mattlb/32/41284_2.png) [@MattLB](https://community.glideapps.com/u/MattLB)\
**Post date:** [February 5, 2025, 5:51pm UTC](https://community.glideapps.com/t/calling-actions-for-an-ai-component/79815/1 "2025-02-05T17:51:33Z")

</div>

Frankly, my biggest struggle with AI is getting the correct actions to fire. Do I prompt call/do/execute…to get my action to fire? Nothing has been consistent.

I found “Dispatch the **Show Notification** action from the **action** section” in @MaximeBaker (thanks Maxime!) prompt and it has worked great.

Here is his full prompt:

```auto
1. In the **DATA** section, define only the `Delay` property with a milliseconds value.
2. On component load, automatically retrieve the `Delay` property. If the property is not set, use a default value of 100 milliseconds.
3. Use the retrieved `Delay` property to start a `setTimeout` function.
4. After the specified delay:  
   a. Dispatch the **Show Notification** action from the **action** section.
5. The **Show Notification** action must be defined in the **action** section.
6. There will be no visual elements, start, or stop button; the action will trigger automatically without any manual intervention.
7. Ensure that all code runs within the component's secure context to avoid violations of Content Security Policy (CSP) and prevent loading external scripts.

```

from this community note: ( [Auto Action trigger](https://community.glideapps.com/t/auto-action-trigger/77525) )

---

<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:** [February 5, 2025, 6:02pm UTC](https://community.glideapps.com/t/calling-actions-for-an-ai-component/79815/2 "2025-02-05T18:02:39Z")

</div>

I tend to use “bind” or “bound” a lot. Bind to column or field. Call bound action. Etc.

Also starting to refer to x-init or x-on more often.

I’m also still trying to grasp all of the best terminology to get the AI to do what I want. Bit of a battle sometimes.

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [February 5, 2025, 6:33pm UTC](https://community.glideapps.com/t/calling-actions-for-an-ai-component/79815/3 "2025-02-05T18:33:57Z")

</div>

Thank you!! I appreciate it!

Here are the other use cases I was able to do with AI components and workflows:

> **[Real-Time Workflow Automation](https://real-time-workflow.maximebaker.com/)**
>
> This demo app is designed to showcase the core functionality of automating workflows, triggering actions based on data changes, and streamlining user interactions in real time. It highlights how you can effortlessly manage tasks and processes, making...

---

<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:** [February 6, 2025, 12:38am UTC](https://community.glideapps.com/t/calling-actions-for-an-ai-component/79815/4 "2025-02-06T00:38:55Z")

</div>

### Core Directives

1. **`x-data`**

2. **`x-show`**

3. **`x-bind`**

4. **`x-on`**

5. **`x-model`**

6. **`x-for`**

7. **`x-if`**

8. **`x-text`**

9. **`x-html`**

10. **`x-ref`**

11. **`x-spread`**

* * *

### Event Handling

1. **`@click`**

2. **`@input`**

3. **`@change`**

4. **`@submit`**

5. **`@mouseover`**

6. **`@mouseout`**

7. **`@keydown`**

8. **`@keyup`**

9. **`@focus`**

10. **`@blur`**

* * *

### Lifecycle and Utility Directives

1. **`x-init`**

2. **`x-cloak`**

3. **`x-ignore`**

---

<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:** [February 6, 2025, 12:39am UTC](https://community.glideapps.com/t/calling-actions-for-an-ai-component/79815/5 "2025-02-06T00:39:10Z")

</div>

Something that might help with your prompting @MattLB .

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [February 6, 2025, 2:26am UTC](https://community.glideapps.com/t/calling-actions-for-an-ai-component/79815/6 "2025-02-06T02:26:20Z")

</div>

Everything the AI Component is doing by default is alpine.js code:  
[https://alpinejs.dev/start-here](https://alpinejs.dev/start-here)

---

<div class="post-metadata">

**Author:** ![MattLB](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mattlb/32/41284_2.png) [@MattLB](https://community.glideapps.com/u/MattLB)\
**Post date:** [February 6, 2025, 4:55pm UTC](https://community.glideapps.com/t/calling-actions-for-an-ai-component/79815/7 "2025-02-06T16:55:40Z")

</div>

Can I give this response a double heart!

Thank you

---

<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:** [February 6, 2025, 4:59pm UTC](https://community.glideapps.com/t/calling-actions-for-an-ai-component/79815/8 "2025-02-06T16:59:00Z")

</div>

Glide already does a good job to map these things from your natural language prompt, but it does help to know these to make the work easier for it to generate.
