You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Ensure you have **Query Collection** or **Document from Reference** added on a widget with **Single Time Query** disabled.
265
-
2. Now select the widget, head over to **Actions**, and click **+ Add Action**.
266
-
3. Select the **On Data Change** tab. That means actions added under this will be called whenever the data changes.
267
-
4. Now, you can
268
-
[add any Action](../../../resources/control-flow/functions/action-flow-editor.md#adding-an-action-example)
269
-
here.
264
+
1. Ensure you have added a **Query Collection** or **Document from Reference** on a widget with **Single Time Query** disabled.
265
+
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.
266
+
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.
270
267
271
268
:::info
272
-
* Actions will be triggered whenever the data is added, updated, or deleted.
273
-
* If you are adding this on ListView, ensure you disable the infinite scroll.
269
+
If you are using this trigger on a ListView, make sure to **disable** the **Infinite Scroll**.
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.
215
215
:::
216
216
217
+
## Trigger Action On Data Change
217
218
219
+
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.
218
220
221
+
To respond to data changes in a Supabase table:
219
222
223
+
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.
224
+
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.
225
+
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.
226
+
227
+
:::info
228
+
If you are using this trigger on a ListView, make sure to **disable** the **Infinite Scroll**.
229
+
:::
230
+
231
+
<div style={{
232
+
position: 'relative',
233
+
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
0 commit comments