How to use workflow to reset a table elements with specific values?

Hello Glide community,

I need a workflow to do 3 actions on one Glide table :

  1. delete all rows where ‘backup’ column value is ‘thrue’
  2. set all (remaining) rows with ‘backup’ column set to ‘thrue’
  3. add row for each IDemployee found in ‘employees’ table and set IDemployee column with same value and ‘backup’ column set to ‘false’

I tried using ‘Remove all elements’ action for point 1) and ‘Set contains element’ for point 2) but didn’t get any satisfying result.

Any help would be appreciated :pray:
I’m on free plan

Hola Emmanuel,

Scheduled Workflows apply for customers with a Business/Enterprise plan only.

Your case can be easily done through a scheduled workflow.

Saludos!

And also on Legacy Team plans.

2 Likes

Hi gvaleros, thank you for helping but I’m not sure I understand why scheduled workflow would be a solution to massively retrieve or modify datas from Glide tables. Isn’t it about the capacity to planify an action whatever action it is ?

May be I wasn’t clear enough with my question.
In fact I want to reset one Glide table a specifc way when clicking on a button.
So far I didn’t find any action workflow functionality that can modify all or several rows in a table.

wished actions are :

  1. delete all rows where ‘backup’ column value is ‘thrue’
  2. set all (remaining) rows with ‘backup’ column set to ‘thrue’
  3. add row for each IDemployee found in ‘employees’ table and set IDemployee column with same value and ‘backup’ column set to ‘false’

for action 1 I tried ‘Remove all elements’ action :
in SQL it would be : delete from Absences-soldes where backup=“1”

for action 2 I tried ‘Set contains element’ action :
in SQL it would be : update Absences-soldes set backup=“1”

for action 3 : don’t have any idea !

may be it’s a Query action that I need and don’t get with free plan…

:wink:

Emmanuel

Element actions are not applicable to what you are trying to do.

This is easy to do with a Delete Row action against a relation that relates to all rows marked for deletion.

This is where it gets more complicated. A Set Column action cannot touch multiple rows. In that case you need to either call a Glide API with a JSON payload of all rows that need to be changed, or as suggested, create a scheduled workflow with a looping action that can loop through remaining rows and use a set column action to set the backup column on each row.

This would again require the Glide API or a scheduled workflow with a loop.

1 Like

Wow !
Now I have a better understanding of scheduled workflow and notice it is common to use APIs within same Glide project to access basic data functionalities…
Ok , I’m gon’a try another approach to what I’m trying to do in my app…

thanks a lot !

1 Like

Hola Emmanuel!

Your workflow is based on an “App interaction” and it’s ok for some cases but what I meant was to use a workflow based on “Webhook” as my image shows

.

This new feature will avoid using many API calls (setups) and will allow you to loop through your entire table to filter and fire actions (add, delete or update rows) on each iteration.

As I wrote before, this tool is not available on free plans but you can try the Business plan free for 30 days and see its potential (the Webhook trigger is coming soon!).

Saludos!

2 Likes