Skip to content

Commit 78c0c67

Browse files
committed
Added Supabase On Data change
1 parent c28eca7 commit 78c0c67

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

docs/ff-integrations/database/supabase/database-actions.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,39 @@ com/embed/244eea2a4f694120b08524b7b8cf67de?sid=13d47ef5-5d48-4986-88da-d335ce23b
204204
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.
205205
:::
206206

207-
208-
209-
207+
## Trigger Action On Data Change
208+
209+
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.
210+
211+
To respond to data changes in a Supabase table:
212+
213+
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.
214+
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.
215+
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.
216+
217+
218+
<div style={{
219+
position: 'relative',
220+
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
221+
height: 0,
222+
width: '100%'}}>
223+
<iframe
224+
src="https://demo.arcade.software/ghFiQWGsQuJu5reUyXnl?embed&show_copy_link=true"
225+
title=""
226+
style={{
227+
position: 'absolute',
228+
top: 0,
229+
left: 0,
230+
width: '100%',
231+
height: '100%',
232+
colorScheme: 'light'
233+
}}
234+
frameborder="0"
235+
loading="lazy"
236+
webkitAllowFullScreen
237+
mozAllowFullScreen
238+
allowFullScreen
239+
allow="clipboard-write">
240+
</iframe>
241+
</div>
242+
<p></p>

0 commit comments

Comments
 (0)