combobox: store user selection to text variable

combobox: store user selection to text variable

  

I have a combobox that is populated by options from a static entity. I want to record the TEXT from the selected option to a variable, but it only allows recording the static entity ID type. I would consider using the special list, but that only allows alphanumeric choices, and I want spaces in between the words. The reason I don't want a static entity is because I've bootsrapped  a ton of data into my app with attributes that already exist as data type TEXT, so I want to be able to create new entities with the same text attributes (but only choosing from a combobox).

I really appreciate any help, thanks!!

Hi,


I am confused?

Combobox = Id + Label, so if you have the id, you can easily get the label as well.


Solution

J. wrote:

Hi,


I am confused?

Combobox = Id + Label, so if you have the id, you can easily get the label as well.



I figured it out, thanks though!

Solution

Hi Ethan,

can you please describe what was your solution to your problem? that way others that go through this post and are facing the same challenges as you just did may learn from you.

Thanks!

Absolutely! I wrote a SQL query in the preparation of that page that takes the name from the attribute and puts it into a new structure of type text. The SQL looks like 

SELECT {EntityName}.[Name]

FROM {EntityName}


Then the combobox can use the SQL query as its source record list (the source attribute and source identifier will be the structure that you assigned the query to) and assign the selection to your text variable. 

I hope I explained it well! Feel free to ask me for more specific details.

Great! Thanks for the explanation, now I also understand better what you're trying to do.

Now tackling your scenario more directly... with your approach, your entities' size will grow a lot more than needed, just by the sheer amount of text repeated unnecessarily.

Consider the following example: You have a Country static entity, and an Address entity with an attribute CountryId. The bootstrap Excel file for Address has a column named Country that holds the name of the country. 

The typical way of approaching this would be to perform a little bit of extra work in your bootstrap code and, for each Excel row, lookup the correct Country record based on the name of the country that is in Excel column Country. Then assign the Country.Id to the Address.CountryId attribute and create (or maybe update) the record. This way you have established an explicit relationship between Addresses and Countries, instead of an implicit one (by name) which allows interesting things like for instance Country name translation.

And this way you could use the combo box with the Static Entity directly too