diff --git a/docs/ff-integrations/database/cloud-firestore/firestore-actions.md b/docs/ff-integrations/database/cloud-firestore/firestore-actions.md index 95647263..0a1cf720 100644 --- a/docs/ff-integrations/database/cloud-firestore/firestore-actions.md +++ b/docs/ff-integrations/database/cloud-firestore/firestore-actions.md @@ -261,26 +261,37 @@ com/embed/238400b5445b444db712f492584b0d6e?sid=7b496882-0280-4920-924c-640fddeff To do so: -1. Ensure you have **Query Collection** or **Document from Reference** added on a widget with **Single Time Query** disabled. -2. Now select the widget, head over to **Actions**, and click **+ Add Action**. -3. Select the **On Data Change** tab. That means actions added under this will be called whenever the data changes. -4. Now, you can -[add any Action](../../../resources/control-flow/functions/action-flow-editor.md#adding-an-action-example) - here. +1. Ensure you have added a **Query Collection** or **Document from Reference** on a widget with **Single Time Query** disabled. +2. Now, on the widget with **Query Collection** or **Document from Reference**, open the **Action Flow Editor** and set **On Data Change** as the [Action Trigger](../../../resources/control-flow/functions/action-triggers.md). This ensures that any actions you add will be triggered whenever the data is updated, added, or deleted. +3. You can now [add any action](../../../resources/control-flow/functions/action-flow-editor.md#adding-an-action-example) you want to perform, such as showing a notification, refreshing the UI, or fetching related data. :::info -* Actions will be triggered whenever the data is added, updated, or deleted. -* If you are adding this on ListView, ensure you disable the infinite scroll. +If you are using this trigger on a ListView, make sure to **disable** the **Infinite Scroll**. ::: -Here is an example showing the -[**Snackbar**](../../../resources/ui/pages/page-elements.md#show-snackbar-action) -message when the data -changes in a collection. - -
- ![img_27.png](img_27.png) -
Trigger snackbar action on data change
-
- +
+ +
+

diff --git a/docs/ff-integrations/database/supabase/database-actions.md b/docs/ff-integrations/database/supabase/database-actions.md index 7e860fe5..8cec322d 100644 --- a/docs/ff-integrations/database/supabase/database-actions.md +++ b/docs/ff-integrations/database/supabase/database-actions.md @@ -214,6 +214,42 @@ com/embed/244eea2a4f694120b08524b7b8cf67de?sid=13d47ef5-5d48-4986-88da-d335ce23b Additional Note: Currently, you can only add "and" conditions to Supabase query filters. If you want to add an "or" filter like "status == 5 or status == 8", you can consider logic to apply "status in (5,8)" or any other logic. Fully customizable using API calls or custom actions. ::: +## Trigger Action On Data Change +Sometimes, you may want to trigger an action whenever data changes in a Supabase table. For instance, in an ecommerce app, you might want to notify users on the orders page when the status of their order is updated. +To respond to data changes in a Supabase table: +1. Ensure you have added a **Supabase Query** to a widget (e.g., a ListView) with **Single Time Query** disabled to enable real-time updates. +2. On the widget with the **Supabase Query**, open the **Action Flow Editor** and set **On Data Change** as the [Action Trigger](../../../resources/control-flow/functions/action-triggers.md). This ensures that any actions you add will be triggered whenever the data is updated, added, or deleted. +3. You can now [add any action](../../../resources/control-flow/functions/action-flow-editor.md#adding-an-action-example) you want to perform, such as showing a notification, refreshing the UI, or fetching related data. + +:::info +If you are using this trigger on a ListView, make sure to **disable** the **Infinite Scroll**. +::: + +
+ +
+

\ No newline at end of file