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
CarlosFigueira
Power Apps
Power Apps

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
CarlosFigueira
Power Apps
Power Apps

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,052)