Make Changes to a List - Apply All Function

Hello,

I have a popup which is designed to make changes to database entries.

In simple terms it has two fields:

Name & Salary

The name is pulled in from one database (an api) and the Salary is a separate data type within Bubble.

I’ve been able to create the correct workflows so that you can edit people’s salary and update the database.

I have also created an update all to the same value button, using the make changes to a list function.

The issue I have is that some names within my list don’t yet have a salary entry within the database.

When updating individual entries I’ve been able to overcome this with the create a new thing function combined with only when and a custom state.

Is there a similar one to apply a number to all of the blank entries and log that within the database? For example if I wanted to give all the blank enteries a value of 10?

Thanks!

You can still use the make changes to a list of things action to set a fixed value to empty salaries. See demo below:
chrome_AwWMm5AD52

Some people, as you see, do not salaries. When I press the button, all empty salaries are updated to be 33 with the action:

You can check the example here: Tests for Forum 10 | Bubble Editor

Hey Hergin,

Thanks for creating this example! It’s really helpful and has partially solved my issue.

The secondary issue I have is that some of the ‘Persons’ don’t exist in my database yet as I’ve pulled this data in from an API into a Repeating Group.

Do you know of a method of not only applying the salaries to all entries already in the data table but also adding the newer entries from the API? E.G Person 9, Person 10, Person 11, etc etc who may not already be stored in our data table?

Thanks again!

Then, what you look for is a database trigger: Database trigger events - Bubble Docs

This way, you can run a workflow when something is created/updated/deleted etc. When a new person is created, set its salary value to something.