Help understanding how to link Switch Button Component's Options to a Database

Hi! First of all, I wanted to clarify that I’m referring to this paid component:

And this is how mine’s looking, each option being specified in the component’s menu:

Okay, so here’s what I’m not understanding. Right now, each “tab” / “option” I’ve written in each option thing that appears in the component’s menu, assigning it a label (the emoji in this case) and a value (its description, useful for other parts of the app).

The component does mention at the beginning two usage options, Free Mode and Control Database Value:

Captura de Pantalla 2022-09-11 a las 3.14.41

Initially I thought the second option might be the way to connect the options to a database, but what I think it does is help with filtering a database, not getting options from a database it’s listing.

As I’m seeing no way to link the component to a database, the magic text isn’t really showing me options from the database (mood options) I’d like it to be feeding off of instead of manually writing each option on the component’s menu.

Any idea on how I could make that happen?

Thanks in advance,

Camila

Hey again. Same answer to your other question on the last thread. This component UPDATES records and you cannot use it on the same screen as the CREATE action. You must have the “Current” record on the same screen as the switch button options.

Create the record BEFORE the user enters that screen and then you’ll see the options to update the current record with the button’s options.

Hi again! Actually, I’m having no issue with it creating a record and saving the selected option after clicking the save button. What I’m having issues with is making the options showing in the selector getting “fed” from a database. Right now, as shown, each option is manually written by me on the component’s menu, instead of being listed out of a database as does happen with other select components (like the multi select dropdown). What I’m trying to figure out (hence my Q) is whether there’s any way to make the options link to a database with the 7 desired options. Not sure if I’m explaining myself correctly, let me know if you have further questions :slight_smile:

Oh, I understand. This one is a little tricky since you can’t pull individual records to fill those parameters.

:bulb: A workaround idea:
Add 7 text parameters to your Users collection and label them Option 1 through Option 7. On your user “sign up” action, set the defaults for those. Any users that have already signed up, you will need to manually enter the records into the 7 new parameters.

You can then use those 7 text parameters as magic text for the options “Logged-in User > Option 1” for Option 1.

1 Like

Ohhhhhhhhhh, that’s genius! I think it might be the solution! Huuuuuuuge thanks! Will try and if to mark it as solved!

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