I have an action that returns a list of Keys and Values (Two attributes), and I pass this action to the Source Record List Property of the Combobox, and it's showing only the Value or the Name, based on what I assign in the source attribute property, but I want to show both Key and Value of each record in the combobx, what is the best way to do that?

Solution

Hello Mohamed, my suggest is: Create a new action encapsulating the original and in this new action you can concatenate the return value with KEY + VALUE for exemple.

If you are using a function action the only way for doing it is concatenating the values.




Best Regards
Paulo Ricardo

Solution

Hello Mohamed,

If you can't change the output of the action for your needs, you could also use a for Each in which you loop the list and change the data of the attribute 'Value' using an assign. Something like: List.Current.Value = List.Current.Id + ' - ' +  List.Current.Value.

Best regards,

Miguel Marçal

Hi,

You can do another way,

1) Create new structure with 2 columns Id and name, called cbdata.

2) Create a local variable with cbdata with list.

3) In action assign new structure with dataset 

4) Immediately OutSystems show columns to match manually.

5) There in Id column do the manual concatenation of id+”-“+value, and value set to value directly.

6) Finally ser cbdata to combo source, 


Thanks,

Balasubramanian