Newbie strugling! Simple output depending on check boxes

Hi there, Hopefully someone can help with this (hopefully) really simple project

I need to create a simple form, probably with check boxes, that when someone hits “Check results” will give information depending on what has been checked.

This is to allow some reception staff to know what needs to happen with a caller depending on the answers to some questions (i.e what appointment(s) they need with whom and for how long)

I am hitting a brick wall and just can’t work out how I do this, whether I need to create some sort of database or what!

Any help appreciated.

The workflow action is when Checkbox A is checked --> do an action in your workflows tab. In this case, it’s likely to save something onto a page state or database.

You can also add conditionals on your visual elements:

Group A:

  • when checkbox A is checked:

    • do an action
  • when checkbox A is not checked:

    • do another action.

cheers :slight_smile:

Cheers. I think that bit I can get my head around, but it is how to create an output in a text box based on the combination of check boxes that i’m strugling with.

For example, if someone selects check box 1, then the output may be “5 min appointment with X”, if they select check box 2 then the output may be “10 min appointment with x” but if they select 1 and 2 then the output could be “10min appointment with y”

Basically, depending on which checkboxes are / aren’t selected I want to build an output that can be displayed. What I am struggling with is where I can “build up” this output before getting it to display in a text box (there are 15 different conditions and various combinations cause various outputs, so some complex logic…)

Can you simplify your logic ?
For example:

Is it really useful to able to choose 1 and 2 ?

The logic isn’t the issue (alas it can’t be simplified as we are talking about patients with multiple conditions and their appointment time / who it is with is dependant on the combination of conditions) but what I am struggling with is simply how, for example, when I click a check box, it updates the text within a text box. Thus if they have condition 1, they will need one type of appointment, but if they have conditions 1 3 4 7 then then they will need different appointments.

As I said, I can work round the logic, it is how I change the text if a check box is clicked.

I have found in the workflow how to trigger something if a check box is clicked, but for the life of me I can’t find how to change the text value of a text box! :frowning:

@ian.m.phillpott, the logic is always the issue :stuck_out_tongue_winking_eye:

In your case, you could add condition like : when: A is clicked and B is clicked and C is clicked -> do something.

Hope this helps :wink:

Its the “do something” bit i’m struggling with. Can’t for the life of me get it to change the text in a text box! It’s one of those things that is probably really simple once you know how but I just can’t find how to do it!! :weary:

Le Do something is what you want to do if Conditions are true, for example show something, record in the database or a go to page X, all that depends on your logic.

For example: when a checkbox A is clicked a text B needs to be shown. The text is invisible on page load and it has this condition: when Checkbox A is clicked -> this element is visible [X]

Hope this helps :wink:

Hi there, @ian.m.phillpott… for someone who is new to Bubble, what you have described is not quite as simple as it sounds, and there are a number of ways you can accomplish it. After thinking about it for a bit, here is how I might go about it.

Create an option set for the checkboxes.

Create a custom data type that has two fields. One of the fields will be linked to the option set, and it should be a list. The other field is the message you want to display when a specific series of checkboxes is selected.

Create entries in the custom data type that define each series of checkboxes and the corresponding message that should be displayed when that series of checkboxes is selected by a user.

Add a repeating group to a page that displays the checkbox options from the option set. Create a custom state on the repeating group that stores a list of selected checkboxes.

Add workflows that add/remove the current cell’s checkbox to/from the custom state list when checkboxes are selected/deselected.

Finally, add a text element to the page, and construct the following expression/advanced filter.

With all of that in place, the text element will display the message from the custom data type that corresponds to the series of checkboxes the user has selected because that series of checkboxes is associated with the message in the custom data type.

Anyway, that probably seems like a lot (or even overkill) when the description of what you are trying to do sounds so simple (i.e., change the text in a text box). That being said, it’s all about how the app is supposed to know what that text is supposed to be, and what I have described is one way to make it happen.

Hope this helps you get down a good path.

Best…
Mike

Cool. I will give that a try! Thanks!

1 Like

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