And, if the name of the player does exist in the database, is there any way to merge the existing row of data with the newly submitted data, so i can keep all reports linked to one player?
Under the create a player workflow step, you’ll want to add a condition (like you’re alluding to) which does a search for players (with constraints player_name = input player_name): count is 0.
That way, if the count of players with the same name is 0, it will create a new one.
Then you can add a new workflow step, which is to change a player. Similar to the create a player step, you’ll add the same condition. Rather than using :count is 0, you’ll use :count > 0.
For the thing to change, you can use the same search, but instead of :count is 0, you’ll want to use :first item.
This will get you the result you are looking for. However, there are better ways to do this for performance purposes. You can research best practices if you think this flow will be slow as your player database grows.
Another thing to consider is if you’ll have multiple players with the same name in the future. For example, chances are pretty decent that if your app grows, you’ll have at least two players named Sam Smith. If/when that happens, there could be some issues with this setup…
Hi, to make changes to a player, you can use the “make changes to a thing” action instead of “create a thing”
It’ll ask for what thing you’d like to change, and you can then “do a search for” that player and filter his name out like you have for the conditional on step 4
As mentioned by @mac2 there’s better ways to do this for performance and reliability reasons, but just to get the hang of things, it works
As a rookie-bubbler I do not expect my set up to be perfect, but I’m eager to learn this- the most effective and smooth way for existing/future projects.
Can you guys please point me in the direction of where I can do some research on best practices on workflows and databases, where add/change/update data fields in the database is reviewed?
totally unrelated: Does anyone ever get nostalgia, looking back at their first project or app in bubble, trying to figure everything out? I remember being in awe of what could be built at such speeds.