Conditional Actions on 4 Numbers

Hello Team. I’ve been exploring conditional actions in Adalo. In short, I have 4 numbers in a data base. I need output from these numbers based on comparing them. I see how to compare 2 of these number within a button and conditional action, but I need to compare at least 3 of them (nested if/then/else). I’ve searched Youtube and this Forum but thus far can’t find a solution. Any help would be appreciated. Thanks!!

Hi @simplytar,

Welcome to the community! :tada:

At the moment, only one condition can be set for the actions. I think it’s mentioned in the docs too. (EDIT: See here - Using Conditions in Adalo | Adalo Resources) What’s your end goal including an example?

Thank you and have a great day!

Dilon, thank you for getting back to me, much appreciated! Yes, I am aware of the one condition limitation; however, I am thinking there must be a work around I’ve not been able to find in the help files…..thus my question. Here is exactly what I am trying to do.

I am working on a golf game, which will have 4 players. When the scores for a hole are recorded, I want to normalize those scores based on the following 5 Conditions. Condition 1: If each of the 4 player’s stroke score is identical, then each player earns zero points. Condition 2: If one player’s stroke score is the lowest score and no other player has a matching score, then the player with the lowest score earns 2 points and the other player’s earn 0 points. Condition 3: If player A has the lowest stroke score, and players B and C have the same second lowest stroke, and player D has the third lowest stroke score, then player A earns 2 points, players B and C earn 1 point each, and player D earns 0. Condition 4: If players A and B both have the lowest score and players C and D both have the second lowest score, then players A and B earn 1 point each and players C and D earn 0 points. Condition 5: If players A and B and C all have the lowest score and player D has the second lowest score, then players A and B and C earn 1 point each and player D earns 0 points.

Any thoughts on an approach/work around would be wonderful. Thanks!!

Hi @simplytar,

You’re very welcome and thanks for the information!

Here’s my take. : Golf Test - simplytar in Adalo forum

Other solutions that in my head instead a loading screen is, using the Pragmaflow’s JS component (not mentioning as the component might get break at some point due to non-maintenance) or use MAKE to do the points processing part.

I love to see other’s solutions in here and also I’m pretty sure Victor might have a better solution.

Thank you and have a great day!

1 Like

Hi,

In my opinion, using external cloud function (CGP, Cloudflare, …) or Make scenario is the best way to implement this.

As @Dilon mentioned, Arbitrary Javascript component could help, but the risk of it breaking is significant. Another way is to create your own custom component, but then you’ll have to maintain it as well.

Best,
Victor

2 Likes

Hey @simplytar,

This nested scoring logic for 4 players (lowest unique = 2 points, ties split 1 or 0) is tricky in because actions can only have one condition each. There is no built-in nested if/else.

The method I’ve used in scoring and game apps is:

- Send the 4 scores to a Make scenario via webhook when you submit.

In Make:

- Receive the webhook.

- Use if/else branches to check the lowest score, count ties, and apply your exact conditions (1-5).

- Calculate points for each player.

- Send the results back to Adalo via webhook to update the records.

This is reliable and works without bugs. It scales well and keeps Adalo for the user interface.

If you want to keep everything native, you can chain multiple actions with calculated properties (like min score and tie counts). However, it requires more steps for complex ties, such as condition 5.

For more on database structure and relationships that are useful for game scoring, check my guide here: From Structure to Connections: Setting Up Effective Relationships in Adalo / A Practical Approach to Structuring Collections in Adalo

Ali Bazzi

Adalo Community Leader & Expert

Templates, Audits & AI Services: webnux.org

Book a consultation: consultation.webnux.org

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.