Update an existing thing if it exists otherwise create a new thing

Is there a way to do this?

I see “create a thing” and “update a thing” but is there a way to try and update and if not then create?

Have a both a ‘create a thing’ and an ‘update a thing’ step in the workflow but put search count conditionals on each.

So create a thing only when search count is 0 and update a thing when search count is >0

3 Likes

Why do I think I tried that and it didnt work. Either im thinking of something else … or im very dumb. Thanks!

Well it works if your search constraints are appropriate :slight_smile: I have implemented this many times :slight_smile:

Hey
Any ideas about this one?

Create a datatype called Dish Ratings and have these fields:

Dish - Type ‘Dish’
User - Type ‘User’
Rating - Type ‘number’ or ‘text’ dependent on your rating system

You could have a list of Dish Ratings on the User datatype but perhaps not the best way if the list could be long. You want to keep your datatypes light.

You can always ‘do a search for’ to pick up all the dish ratings from the user or all the ratings on a dish.

Ok. Now let me throw in the puzzle piece.

Use a multidropdown control to

  1. Show existing dishes that the user has selected
  2. Allow user to add new dishes
  3. Allow user to delete dishes.
    and handle rating the dishes elsewhere.

Yup all doable :slight_smile:

Once something is in the database you can call it in to the UI anywhere on your app.

You just need to set up the right elements with the right constraints, conditionals and workflows to do everything that you want.

How do you do the three things? Especially deleting the dish ratings? “removing” in multidropdown control is done with backspace.

It’s a bit hard to give you a specific answer because there’s a lot of variables that would go in to the best solution.

There’s a workflow action ‘delete thing’ for deleting things.

It’s up to you as the developer to work out the appropriate UX for your use case and then build out the corresponding elements (UI) and workflows behind them.

If you are needing more help than quick forum posts or googling then I’d suggest a coach as that will really get you past some roadblocks quickly :slight_smile:

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