The dropdown default value is not being retrieved from the database

I am attempting to set the user’s nationality as the default value, but it is not functioning. Please advice

The default value for a Dropdown MUST (obviously) be the same type as the Dropdown choices.

In your case, your Dropdown Choice Type is ‘Get All Countries’ (which I’m guessing is an API call), which is obviously not the same type as expression you’ve entered in the default value box.

I’ve no idea what the type of either of those things are in your database, but the issue is that they are not the same.

So that’s what you need to fix.

Hi, is the nationality a list in the database? Because if that’s the case the nationality is not able to be a default value, because there are mutiple options possible.

Hi, the nationality field in my database is stored as text. I want to retrieve the user’s selected nationality and set it as the default value in an edit profile popup. This way, the user can see their current nationality and have the option to change it if needed.

Well then that’s your issue… as I said, the type needs to be the same.

You either need to change the dropdown type to the same type as the database field, change the database field to the same type as the dropdown type, or do some filtering/searching on the dropdown to match the dropdown choices to the stored text field.

I’d recommend changing the database field type to match the dropdown choices type.

1 Like

Again… it’s a type mismatch…

You’re trying to set the value to the dropdown’s Nationality’s Name which, presumably, is a ‘Text’. But the field is of the type Nationality.

So they are not the same.

Assuming the field is now of the same type as the dropdown, you need to set it to a value from the dropdown (not a text value of one of the dropdown’s value’s properties).

So just get rid of the ‘name common’ bit in the expression.

Thanks! it worked

1 Like

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