cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Johwe32
Frequent Visitor

Update/patch combobox

Hey

 

I'm using a list (["1";"2"]) as items for a combox which is placed in a form. I then set the Update value of the form item to Concat(Combobox_value.SelectedItems;Value;",") which creates a string separating the items with a ",". This works fine.

 

I changed the items of the combobox to Distinct(data;column) which works, I can choose them. However the update formula creates an error. It can not create the string. What am I doing wrong? Feels strange since the data output of the combox has not changed, only the input (which works)?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Update/patch combobox

When you define a table using the '[<v1>; <v2>; <v3>]' syntax, it's equivalent to the following definition:

Table({ Value: <v1> }; { Value: <v2> }; { Value: <v3> })

In other words - a table with a single column called 'Value'. If you assign it to the Items property of a selectable control such as the combo box, then when you access the 'Selected' (or 'SelectedItems') property, you need to use the '.Value' to access the actual value that was selected.

 

The Distinct function, however, returns a table with a single column called 'Result', not 'Value', so if you use it in the combo box's Items property, to access the selected value you need to use that property instead. If you update your expression to the one below, you should get the result that you want.

Concat(
    Combobox_value.SelectedItems;
    Result;
    ",")

View solution in original post

1 REPLY 1
Highlighted
Power Apps
Power Apps

Re: Update/patch combobox

When you define a table using the '[<v1>; <v2>; <v3>]' syntax, it's equivalent to the following definition:

Table({ Value: <v1> }; { Value: <v2> }; { Value: <v3> })

In other words - a table with a single column called 'Value'. If you assign it to the Items property of a selectable control such as the combo box, then when you access the 'Selected' (or 'SelectedItems') property, you need to use the '.Value' to access the actual value that was selected.

 

The Distinct function, however, returns a table with a single column called 'Result', not 'Value', so if you use it in the combo box's Items property, to access the selected value you need to use that property instead. If you update your expression to the one below, you should get the result that you want.

Concat(
    Combobox_value.SelectedItems;
    Result;
    ",")

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (5,786)