Select data bound to server connect?

Hi there, followed this tutorial to create a select dropdown with db data.

The tutorial proposes a get form but I actually needed it loaded into a post type form.

Is there a way to connect them directly or do I need some kind of bridge?

TIA

Screenshot 2024-02-09 at 22.42.33

Edit:
It picks up the object from db but it is not converted into field values, due to missing mappings

Hi @pedroponte!

I see that your form is inside a modal. Do you have your server connect, getCountries, set to load on the page or do you have the No Auto Load turned on?

Screenshot 2024-02-09 at 6.13.28 PM

If you have the No Auto Load turned on, then whatever button or link you have on the page will need to have a Dynamic Event > Click added to load the server connect when clicked. You would want to do this before the modal is shown. (You can ignore the “id” field in the image below if you do not have this set on your server action.)

If you do not have No Auto Load turned on, and you are not seeing the options, try saving the page and refreshing the page to see if the options appear.

Screenshot 2024-02-09 at 6.23.54 PM

1 Like

Hi @pedroponte,

Please share your code or screenshots of:
1) the output (response) of your getCountries serverconnect when running on your browser

2) the select code in your code view to see exactly which value of the serverconnect is binded there

I suspect you have binded wrong datasource to your select that’s why you get [object Object] there…

  • I suggest you to move your serverconnects at the beginning of your page (before modals or anything else)

Thank you!

Moved them up. No auto load is not checked

Pics below as per above.

TIA

please a screenshot of the select code
I need to see exactly what is binded there

i need the SELECT drpdown code… Not the Query

:smiley: sorry, my bad!

Screenshot 2024-02-10 at 14.10.49

I don’t see optionText and optionValue there…

The value that will be displayyed in the list and the value that will be saved on the select when clicking

Because they don’t show in the

++ EDIT ++

data binding pick option.

If I key them in manually, then I get a static value.

Then the only thing I think of is that is something wrong with the datasource value…

Please delete that value, click the ligntening bolt and expand the panel options to see the query and take a screenshot

ok I show it… Seems Correct!

Please DELETE the starting and end single quotes from the optiontext and optionvalue

Fire again and tell me if it works

WRITE THE CORRECT VALUES!!
** optiontext=“name
** optionvalue=“uuid

I owe you two rounds now! Thank you sir!

1 Like

Please do me a favour…

Create a new modal and repeat the correct steps we did… (you will delete it after this test)
Do you have the options in the UI? Or it is empty again?

will do shortly and revert.

Same with new modal.
Would you like the whole page code?

EDIT - video attached

1 Like

Thanks! This seems to be a bug…

Can you tell me what this error is down there?

was missing a /div, fixed, thank you again!

1 Like