Iterate list and save to another table

Guys, I’m in need of some help.

I need to search a table for students, students who have a specific field, until then I can do it.
The problem is that I need to iterate over these students and create a new record in another table using these students, which I am not able to do.

Thanks!

Check Recursive API Workflows - Bubble Docs in order to create a list of things.

Is it only possible to do using this feature? At the moment I still don’t have the Bubble paid plan.

You could use the liftshifter plugin from @keith

But I wouldn’t advise using iterative workflows in page to run sequential database actions, which I’ve discussed at length, most recently here:

@keith Thanks for everyone’s support!

what I would like is:
when I create a class, I get the students that are related to a team, so that I can then have a field to say if the student attended the class or not.
would you have any suggestions?

@ti16 and others follow my solution without using back-end workflows.

I think I can improve and maybe improve performance, but at first it hasn’t presented me with an error so far.

Solution:

On my create class screen, I created an active WF by clicking on the Save button.
Actions: Create an item in the Class table, then I used a custom states to search for students with a constrain = the team in which he participates, after that moment I opened a small Popup informing that the class is being created, along with an animation. Then I paused for 6 seconds and then closed the popups and cleaned the inputs.

In parallel create another WF that occurs every 0.3 seconds, but it only starts through a rule, in this rule I determined the following:
When the custom states have more than one record, this WF will be triggered, I configured it this way because the custom states are only created after saving the class, that is, if the user does not want to save this WF, it does not happen.

Then it iterates because there is a list of students and it saves item by item, then I take the created record and make changes to it, informing the team about it, in the final step I set the custom states and made a rule to clean it up this list, even make the record not duplicate, in the value field I did:
I set the custom states:minus item and the last record made, I did this for both the students and the team, so it performs the actions, the loop and eliminates the records.

I’m not sure if this is the best way, but at the moment it was the one I found to solve my problem and without using the back-end that at the moment my plan is free.

Credits: People I learned from and I think are worth mentioning, thanks for sharing the knowledge!
@renatoasse @artemzheg @keith David Rocha - Rede No Code.

This topic was automatically closed after 70 days. New replies are no longer allowed.