I need help with my database

When a user signs up, a backend workflow will need to create 30 entries for a thing in the database, but each one of those entries has heaps of other fields (see my notes in image below ~15) thats 15 x 30 (450 things to create).

Screen Shot 2022-09-14 at 7.41.43 pm

Surely there’s a better way than to create 450 of these. How can i perhaps make all 15 once and have it apple to all 30 entries (that also need to be created somehow)
Screen Shot 2022-09-14 at 7.48.09 pm

I’m not sure I understand…

You’re only creating 30 Things (not 450)…

but in any case it wouldn’t matter if you were…

You just need to run a recursive backend workflow to create each thing (i.e. a workflow to create a thing, and run it 30 times).

1 Like

So when a user makes an account i want it to create 30 things (“habits” which are laid out currently in options set) and for each of those 30 habits there needs to be these fields.

But each of the 30 habits are different:

right before signing up a user selects their habits so maybe that’s how i should pass that habit name through to the backend workflow?

Just send the list of ‘Options:Habits’ to the backend workflow, and run it recursively on each item in that list (running the backend workflow directly on this list, using ‘schedule backend workflow on a list’, will probably also work fine as the list is small)

I don’t know how you’re intending to populate the field values though (are they all the same for each new Routine Habit? Or does each database entry have different values for each field?)

Later on in the app experience when user’s tick off a habit it will modify its completed “no” to completed “yes”, for example

1 Like

That keeps it nice and simple…

As I said, just send the list of Option:Habbits to the backend workflow…

Running the workflow on the list directly (rather than recursively) will probably work fine (but you might need to test it)… otherwise just run the workflow recursively to create each item.

How do i send the option set through? it wants one entry instead of letting me say all of them

You must not have set the ‘habit’ parameter on the backend workflow to be a list…

Make sure to check the ‘is list/array’ box on the backend workflow parameter if you want to send a list to it.

1 Like

Yep. I learn again.

Ok so i still have two things to make work:

  1. making the database entries

  2. make it change the entries that the user selected to say chosen = yes

So, when the user signs up i was having it schedule a backend workflow to create the users habits and do a a few other things


But are you saying this scheduled workflow should also schedule a workflow in step one instead of step one being “create”

You’ll need to use a separate workflow to create the database entries… you can schedule that from this one (or even run it on a list).

  1. make it change the entries that the user selected to say chosen = yes

Do you need to create an entry for all 30 options? Can’t you just create entries for those options they selected?

If not (i.e. if you need to create all 30), then the simplest way to do it would be to create them from two separate lists…

The first list is the options they selected (with the value set to ‘yes’)

The second list would be ALL the options, minus the ones they selected (with the value set to ‘no’)

This is all getting a bit confusing for me.

How it the nested API workflow supposed to know the keys of the first workflow?

Just pass them into it as parameters…

Ok here is where i’m currently stuck

Oh i think i just had the type of thing wrong

So now what’s next? what do i tell this second API workflow (named “create habits”) to do?

In the ‘Schedule Workflow Create Habits on a list’ action you’ll want to change the ‘habits’ option to ‘This habit’, so that the habit in the workflow is the one the workflow is being run on.

Then in the Create Habits workflow just add a single action to create the habit.

Where did this “this habit” thing you speak of come from?