Howdy
In my Contact-details form (input), there is a drop-down menu for Contact’s country. I only have two entries coming from Option Set (OS Contact Country). As a user fills out the form, all fields get updated in the database well, including this one. Then I created another protocol to allow the user to edit the Contact. All the fields (except the country dropdown) show initial data. The dropdown field still shows (Select one…) but not the specific country the user had already chosen, which means with every edit they have to re-select their country. I have tried a million ways to fix this seemingly simple thing, but I went no where. Any help is appreciated. Thanks in advance folks
Have you set the default value correctly?
What does it show in the debugger?
So the answer is ‘no’…
You haven’t set the default value (which is what you need to do).
Every time I type something, it shows me wrong (red) text
Click more and ss
The default value has to be a valid value (meaning of the correct datatype, and one of the available choices).
In your case, it looks like a type mismatch.
As I said the expression you enter in the default value MUST be of the same type as the dropdown type.
sorry I don’t undrstand
You get error maybe you should use display or last item , click more and show the options you have to remove error
Not sure if default value is relevant in this case. I want the drop-down to show whatever the user has specified for that specific customer, just like all the other fields: name, phone number, etc. I can have the default to be Canada for example when a user inputs their customer’s data for the first time, but when they click on that customer to edit, I want the country drop down to show what they had already chosen and not the default country
well, isn’t that obvious?
That’s exactly what the default value is for.
It looks as though you have some confusion about working with datatypes in Bubble…
As I said, you can’t mix and match datatypes in Bubble… which is what you’re current expression is doing.
Set a global country custom state and set that as default when user selects Canada reset that dropdown holder group and set that global state as Canada , that is equavelent to set value of an input
yes, I’m fairly new. Then how can you explain whatever I choose from the default value submenu I get an error:
which of DATA SOURCES do I choose?
Well, without seeing your database I can’t tell you what the expression should be…
Logically, it should be exactly what you’ve entered already (i.e. Parent Group’s Contact’s Contact Country), but evidently that’s a type mismatch, as I said, so it looks like you’ve set up your database field types incorrectly.
What ‘Type’ is the contact country field on the contact datatype?
Make data type of the contacts Country to option set Country, right now it is text than do what I have told you about that global custom state
Like you both said, I had my Contact Country set as a text and not an OS. I just changed it and it worked well. Thanks a lot for your help.
This topic was automatically closed after 70 days. New replies are no longer allowed.