about DropDown
Question

I create a dropdown and now I want to add two attribute from an entity to make up a dropdown text like '52 : England','52' from an attribute, "England" from another attribute.Can anyone help with this?

mvp_badge
MVP
Solution

Hi mh Chen,


Make a query to your entity, create a new attribute (in my example I called it DisplayName) with your logic to get the display name as you want (in my case, Id: Label).


After that, on the Dropdown properties, you should have the query filled in the List property, the new attribute filled in the Options Text property and your Id in the Options Value property:


Hope it helps.


Kind Regards,
João

Thank you for your answer and I still have a question. How can I create a calculated attribute  like you.

Best regards,

chen

 

mvp_badge
MVP

Hi mh Chen,


New attributes or calculated attributes only exist on the scope of aggregates.

To add an aggregate to your screen, you can right click the screen where you want to have the dropdown and choose the option Fetch from the database:


After that, you can drag your entity PullDown to the aggregate, and now you'll have the option New attribute. After you select the option New Attribute, you can set its value and name properties on the right bottom panel like on the image below:


After that, you will be able to set the List of the dropdown as the query and have the calculated attribute (in my example DisplayName) as an option, as shown on my previous message.


Kind Regards,
João

Hi João Marques,

I got it ,thank you so much.

Kind Regards,
Chen


Hi mh Chen,

You can put an Expression widget in the DropDown and set its value attribute to something like Entity.Number + ": " + Entity.Country.
There is an example here.

Hope it helps

Best regards

Thank you for your answer. I've thought about it before ,but I failed. I cant  put an Expression widget in the  Dropdown. I don't kown why. Could you tell me the reason or tell the way to solve it.

Best regards 

Chen.

 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.